我有MVC Spring調度員的問題。我的項目是這樣MVC春季調度員和資源文件
myproject
|-- webapp
|-- themes
|-- theme1
|-- assets
|-- css
|-- js
|-- img
...
|-- views
|-- theme2
|-- assets
|-- css
|-- js
|-- img
...
|-- views
|-- WEB-INF
而且我web.xml
文件結構:
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Mapping -->
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/themes/*</url-pattern>
</servlet-mapping>
我增加了默認的映射*的.css,* .js文件,但我不能訪問它們。請幫幫我。
加成信息 我通常可以訪問這些文件
/myproject/themes/theme2/assets/js/theme.js
/myproject/themes/theme2/assets/js/common.js
/myproject/themes/theme2/assets/js/main.js
但不
/myproject/themes/theme2/assets/plugins/jquery/jquery-1.10.2.min.js
/myproject/themes/theme2/assets/css/*.* // cant access any css files
刪除servlet映射(s)作爲'default'並將' '添加到'DispatcherServlet'配置中。 –