On Apr 14, 2010, at 1:31 PM, ashishsinha.ashish_at_gmail.com wrote:
>
> I am using Jersey API for one of my applications.
> The URI is in form "/something/operation".
> The application works perfectly fine, when any of the allowed values for "operation", is passed.
> If however we do not pass any value for "operation", application fails with a HTTP 404.
> My requirement is to capture this null value of operation and throw a custom error response.
>
> Is it possible to capture?
> If so, please provide some information.
>
> My resource class has following structure:
>
>
>
> @Path("/something/{operation}")
Try @Path("/something/{operation: [ˆ/]*?}")
The default regex is [ˆ/]+? which requires at least one character for a match.
Marc.
> public class Something{
>
> @POST
> @Consumes({MediaType.APPLICATION_XML, MediaType.WILDCARD})
> @Produces({MediaType.APPLICATION_XML, MediaType.WILDCARD})
> public Response getResponse(){
> ...............
> }
> }
>
> Thanks for the help.
>
>
> Ashish