Spring 带Jsp的Jersey
这是我的web.xmlSpring 带Jsp的Jersey,spring,jsp,jersey,Spring,Jsp,Jersey,这是我的web.xml <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/beans-web.xml</param-value> </context-param> <listener> <listener-class&
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beans-web.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<servlet>
<servlet-name>Jersey Spring Web Application</servlet-name>
<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
<param-value>/WEB-INF/jsp</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.Redirect</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.ImplicitViewables</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/(images|css)/.*</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Spring Web Application</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
再次在内部重定向到
3 > GET http://localhost:8082/so/WEB-INF/jsp/index.jsp
3 > Host: localhost:8082
3 > User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10
和失败信息:
3 * Server out-bound response
3 < 404
INFO: 2 * Server out-bound response
2 < 200
2 < Content-Type: text/html
3*服务器外部绑定响应
3 < 404
信息:2*服务器外部绑定响应
2 < 200
2<内容类型:文本/html
如果我将根上下文放在/v1/*上,效果很好
我遗漏了什么吗?请参见此处接受的答案。您必须使用SpringServlet作为过滤器,而不是web.xml中的servlet
3 * Server out-bound response
3 < 404
INFO: 2 * Server out-bound response
2 < 200
2 < Content-Type: text/html