ich eine Feder Projekt, wo ich die folgenden webjars in pom.xml
enthalten:Spring MVC mit Thymeleaf + Bootstrap mit webjars
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.1.1</version>
</dependency>
Dann habe ich in meinem html den folgenden Link und Skripte anzuzeigen enthalten:
<link rel="stylesheet" href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}" />
<script src="@{/webjars/jquery/3.1.1/jquery.min.js}"></script>
<script src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
Aber es hat nicht funktioniert, findet keine Zuordnung:
[org.springframework.web.servlet.PageNotFound] (default task-15) No mapping found for HTTP request with URI [/TestPublicWeb-0.0.1-SNAPSHOT/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css] in DispatcherServlet with name 'testapp'
... so I versucht, die folgende Abbildung in servlet.xml enthalten:
<mvc:resources mapping="/webjars/**" location="classpath:/META-INF/resources/webjars/"/>
Aber mit diesem, Mapping für meine /TestApplication
nicht gefunden wird:
[org.springframework.web.servlet.PageNotFound] (default task-13) No mapping found for HTTP request with URI [/TestApplication/] in DispatcherServlet with name 'testapp'
Wie sollte auf eine korrekte Art webjars enthalten in sprinf Projekt?