我在訪問我的靜態資源時遇到問題/project/resources/(css|js)/
。我能夠訪問我的css文件夾中的index.css
,但沒有其他。我試圖找到根本原因,改變了正則表達式,並搞砸了一切。現在我無法訪問,現在甚至無法訪問index.css
。請從下面的詳細信息 -澤西島休息時無法訪問的靜態資源
文件結構 -
webapp
|____ resources
| |____ css
| |____ js
|
|____ WEB-INF
|____ jsp
web.xml中 -
<?xml version="1.0" encoding="UTF-8"?>
<!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html -->
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>REST Web Application</filter-name>
<filter-class>org.glassfish.jersey.servlet.ServletContainer</filter-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.restui</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.mvc.templateBasePath.jsp</param-name>
<param-value>/WEB-INF/jsp/</param-value>
</init-param>
<init-param>
<param-name>jersey.config.servlet.filter.staticContentRegex</param-name>
<param-value>/(resources/(css|js))|(WEB-INF/jsp)/*.*</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.classnames</param-name>
<param-value>org.glassfish.jersey.server.mvc.jsp.JspMvcFeature</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>REST Web Application</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
我試圖找到網絡上的解決方案,但沒有什麼是有用的。希望得到有用的解決方案。
在此先感謝。
你有沒有收到一個404 Not Found錯誤? – nnunes10