Hi
On Wed, Mar 23, 2011 at 9:00 PM, KARR, DAVID (ATTSI) <[email protected]> wrote:

> I have a controller with a root "@Path()" annotation.  I have controller
> handler methods in that class with "@Path()" annotations.  If I supply a
> valid URL that matches the controller and one of the handler methods, it
> works fine.
>
> If I supply a URL that matches at least the root Path for the controller,
> but not any of the handler methods, it understandably gets a 404 back.
>
> Is there any way I can write a handler method, along with the all-important
> "@Path" annotation, which will match any request that isn't matched by any
> of the other handler methods?
>

CXF allows customizing the selection algorithm [1] but it might useful when
several matching root resources or methods are available.

You might want to introduce a resource method with a Path value containing a
regular expression, say:

@Path("{id:.*}")

This Path will capture everything but the method will be selected only if no
other, more specific matches have been found. Give it a try please.

Cheers, Sergey




[1]
http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Customselectionbetweenmultipleresources

Reply via email to