users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Default Servlet Mapping?

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 19 Mar 2012 10:01:24 -0400

On 3/15/12 4:15 PM, Santiago Pericas-Geertsen wrote:
>
> On Mar 15, 2012, at 4:00 PM, Bill Burke wrote:
>
>>
>>
>> On 3/15/12 3:54 PM, Santiago Pericas-Geertsen wrote:
>>>
>>> On Mar 15, 2012, at 3:31 PM, Bill Burke wrote:
>>>
>>>> I would say do nothing because it would break existing 1.1 applications when deployed.
>>>
>>> How so? Before you had to always specify the mapping, and that will continue to take precedence. Can you elaborate?
>>>
>> We assumed everything could be scanned, you could have an empty web.xml file, and no Application class. This was an incorrect assumption? I know a lot of people use us in this manner. Maybe I just interpreted the 1.1 spec wrong?
>
> Class scanning and servlet mapping are orthogonal. The only way you can get the servlet mapping in 1.1 is from (i) a web.xml or (ii) the @ApplicationPath annotation on an Application subclass AFAICT, with (i) overriding (ii) if both are present. For the other cases, 1.1 states that "the application MUST be packaged with a web.xml that specifies a servlet mapping for the added servlet".
>
> Perhaps you're already using a default in Resteasy?
>

Well, then the spec should allow the case for *no* Application class and
no web.xml listing. The default mapping should be "/*" and should work
with static content too. This way its very simple for users and no
thought has to be put into anything.

Bill

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com