users@jersey.java.net

Jersey and url-pattern.

From: Damian Steer <d.steer_at_bristol.ac.uk>
Date: Wed, 10 Feb 2010 14:01:59 +0000

Hi,

I recently moved my application from jersey 1.0.3.1 to 1.1.5, to remove
the need for appengine hacks.

I only have one resource:

@Path("translate")
public class Translator { ...

My web.xml says:

<servlet-mapping>
         <servlet-name>ServletAdaptor</servlet-name>
         <url-pattern>/translate</url-pattern>
</servlet-mapping>

(This is the jersey servlet container)

In 1.0.3.1 that seemed to be fine. I could GET and POST to translate,
but / routed to my index.html and all was well.

In 1.1.5 /translate 404s. Changing url-pattern to /* works, but it
breaks /. Is there a way to only pass /translate to jersey?

Thanks in advance,

Damian