안녕하세요이 내 빌드 경로에 다음 항아리 -봄 3
봄 콩 - 3.1.2.RELEASE.jar
스프링 상황 3.1.2.RELEASE.jar
스프링 코어 3.1.2.RELEASE.jar
봄 표현-3.1.2.RELEASE.jar
스프링 웹 3.1.2.RELEASE.jar
봄-webmvc-3.1.2.RELEASE.jar
thymeleaf-spring3-2.0.13.jar
내 서블릿
<?xml version="1.0" encoding="UTF-8"?><br>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<context:component-scan base-package="web.controller" />
<!-- Enabling Spring MVC configuration through annotations -->
<mvc:annotation-driven />
<!-- Mapping Static Resources -->
<mvc:resources mapping="/resources/**" location="/resources/" />
<bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".html" />
<property name="templateMode" value="HTML5" />
</bean>
<bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
</bean>
<bean class="org.thymeleaf.spring3.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine" />
<property name="order" value="1" />
<property name="viewNames" value="*.html" />
</bean>
</beans>
내가 발사에 얻을 오류입니다 -
찾을 수 없습니다 클래스 [org.thymeleaf.templateresolver.ServletContextTemplateResolver] 이름의 빈을위한 'templateResolver'의 ServletContext 자원 [정의 /WEB-INF/springMVC-servlet.xml]; 중첩 예외는 java.lang.ClassNotFoundException : org.thymeleaf.templateresolver.ServletContextTemplateResolver 다른 라이브러리가 누락 되었습니까? 어떤 도움이라도 대단히 감사합니다.
감사에서 jar ... 나는 빌드 경로에 thymeleaf-2.0.13.jar를 추가했다. 하지만 새로운 에러가 발생했습니다 - org.springframework.beans.factory.BeanCreationException : ServletContext 리소스 [/WEB-INF/springMVC-servlet.xml]에 'templateResolver'라는 이름의 빈을 생성하는 중 오류가 발생했습니다 : 빈의 인스턴스화가 실패했습니다 – user1755645
스택 트레이스? 다른 항아리가 없거나 다른 문제가 무수히 많을 수 있습니다. 버전 문제 일 수도 있습니다. thymeleaf-spring3-2.0.13.jar을 thymeleaf 사이트의 thymeleaf-spring3 병으로 교체하십시오. – chrislhardin
패키지를 다운로드하고 오류가 사라졌습니다 ... 덕분에 – user1755645