0

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"?>
<!-- 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#d4e194 -->
<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.path.to.app</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>

brinxmat
  • 1,191
  • 1
  • 10
  • 13
  • [406](http://stackoverflow.com/questions/14251851/what-is-406-not-acceptable-response-in-http)? I would have expected a 404. Have you tried removing the `WebPageContentRegex` filter to see if the error still occurs? – DannyMo Nov 26 '13 at 23:25
  • I tried to no avail. There is probably some underlying issue in the way I'm managing the paths. – brinxmat Dec 13 '13 at 08:54

0 Answers0