Skip to main content

Wildcard URL matching when using HTTPBinding

1 reply [Last post]
cparis
Offline
Joined: 2005-05-08

I've been looking through the Glassfish source for the deployment descriptors, and it doesn't appear that there is a way to customize the servlet-mapping when generating internal web.xml file.

I am building a RESTful web service, and would prefer to use URL patterns instead of query string parameters. (ie, GET /rest/Product/1234 and not GET /rest?t=Product&pid=1234).

So, I would like to be able to do have the web.xml mapping look more like:

ApiREST
/rest

ApiREST
/rest/*

Is there any way to do this in the annotations that I'm missing? Or do I need to deploy my own web.xml, webservices.xml, wsdl, etc and all the other stuff that goes with having to do that?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

glassfish@javadesktop.org wrote On 04/27/07 05:16 PM,:

>I've been looking through the Glassfish source for the deployment descriptors, and it doesn't appear that there is a way to customize the servlet-mapping when generating internal web.xml file.
>
>I am building a RESTful web service, and would prefer to use URL patterns instead of query string parameters. (ie, GET /rest/Product/1234 and not GET /rest?t=Product&pid=1234).
>
>So, I would like to be able to do have the web.xml mapping look more like:
>
>
> ApiREST
> /rest
>

>
> ApiREST
>[b] /rest/*[/b]
>

>
>Is there any way to do this in the annotations that I'm missing? Or do I need to deploy my own web.xml, webservices.xml, wsdl, etc and all the other stuff that goes with having to do that?
>
>

I may have misunderstood your question, but the Servlet spec already
supports path (prefix) mappings, which are specified using a string that
begins with a '/' character and ends with a "/*" suffix.

See SRV.11.2 ("Specification of Mappings") of the Servlet spec for details.

This means that:


ApiREST
/rest/*

is a valid servlet mapping.

But again, I may have misunderstood your question ...

Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net