我正在尝试在jsp中链接图像,css和js,但它没有在我的html中解析( chrome控制台输出:405(方法不允许))
项目结构
我已经在web.xml中为这些资源做了映射
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
<url-pattern>*.js</url-pattern>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
这是资源的资源映射
<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:default-servlet-handler />
<mvc:annotation-driven />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles2.TilesView
</value>
</property>
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/config-files/tiles.xml</value>
</list>
</property>
</bean>
JSP页面
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="page-header" class="flag-container">
<div class="row">
<div class="col-xs-2" id="header-logo">
<a href=".">
<img src="<c:url value="/resources/img/logo.png" />" title="logo" />
</a>
</div>
</div>
</div>