在練習尚硅谷雷豐陽老師的SSM-CRUD整合的時候,因為使用的Thymeleaf,而不是jsp,跟着老師操作所有會出現一些錯誤,現在我把這些錯誤都整理一下,希望能幫助到有用的朋友。
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/DispatcherServlet-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/DispatcherServlet-servlet.xml]
錯誤:[/WEB-INF/DispatcherServlet-servlet.xml]
因為使用的是Thymeleaf解析器而不是JSP+ JSTL, 我出現這個錯誤的時候是因為jsp 換成了thymeleaf 但是把 index.html放在了 WEB-INF目錄下 而不是放在了thymeleaf指定的文件目錄下 所有thymeleaf視圖解析器,所以解析不到。
把位置放對就OK了。