I use the following web.xml to provide support for jsp in a Jersey web app. The only problem is that using multiple @PathParam causes the application to return 406 Not acceptable. I believe that this is an issue in the filter in web.xml, as single @PathParams work fine. Am I completely wrong? Any suggestions for a fix gratefully received!
<?xml version="1.0" encoding="UTF-8"?>
<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>jersey</filter-name>
<filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.example.my-app-name</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.property.WebPageContentRegex</param-name>
<param-value>/(css|images|resources|(WEB-INF/jsp))/.*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>jersey</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
I asked this question on stackoverflow
http://stackoverflow.com/questions/20155865/jersey-is-web-xml-preventing-use-of-multiple-pathparams previously.
Rurik Thomas Greenall
NTNU University Library | NTNU Universitetsbiblioteket
rurik.greenall_at_ub.ntnu.no
@brinxmat
http://folk.ntnu.no/greenall