Hi Nam,
Nam Nguyen wrote:
> Hi,
>
> Currently tool generates a fixed (non-configurable) value:
When you say 'tool' do you mean the NetBeans tool or the Jersey
WebResourcesProcessorTask tool?
The latter tool is configurable, for example use the following:
<option key="urlpattern" value="/*"/>
to generate in the web.xml the following:
<servlet-mapping>
<url-pattern>/*</url-pattern>
</servlet-mapping>
> for this
> servlet-mapping/url-pattern:
>
> <url-pattern>/restbeans/*</url-pattern> (we will change this to
> '/resources/*' matching the new jersey SimpleServlet sample)
>
> The effect is that RESTful application's URL space has to include
> "restbeans", e.g.:
>
> http://www.acme.com/BookStore/restbeans/books/12345
>
> This is kind of undesirable compared with just:
>
> http://www.acme.com/BookStore/books/12345
>
I agree that this can be a problem.
> We wonder if we could just use:
> <url-pattern>/*</url-pattern>
> so the latter URL is possible.
>
The issue i have with making the default URL pattern be '/*' is that the
servlet adapter will currently consume all URLs including those for any
content in the Web pages (HTML or JSPs etc), and so will return 404 (Not
Found) for existing Web pages. You can verify this for yourself by
playing around with the SimpleServlet example.
Two possible solutions are:
1) The servlet adapter forward any URLs it does not know about. I
think this can be done but there still could be clashes between URLs
consumed by the resources and URLs that refer to content in the Web
pages, which may not be an issue. I need to look into this further to
see if this is something that should be specified by 311 servlet
support or not.
2) The NetBeans tool allows the developer to select the base URL of the
resources.
and perhaps 2 is desirable even if 1 is supported?
Paul.
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109