From Chapter 12 of Servlet 3.0 spec, this corresponds to request url
which need to have "/".
So, I would recommend to have the leading "/" in order to have a
portable application.
Shing Wai Chan
On 10/4/2010 5:08 PM, Sreekanth wrote:i.chan_at_oracle.com
<mailto:shing.wai.chan_at_oracle.com>> wrote:
>
> We need a leading "/" in this case.
> See examples in Servlet 3.0 specification.
> Shing Wai Chan
>
>
>>
>> -------- Original Message --------
>> Subject: usage of @WebServlet
>> Date: Fri, 01 Oct 2010 19:44:05 +0530
>> From: Sreekanth <Sreekanth.Manga_at_Sun.COM>
>> <mailto:Sreekanth.Manga_at_Sun.COM>
>> Reply-To: dev_at_glassfish.dev.java.net
>> <mailto:dev_at_glassfish.dev.java.net>
>> To: dev_at_glassfish.dev.java.net <mailto:dev_at_glassfish.dev.java.net>
>>
>>
>>
>> Hi,
>>
>> Are these 2 usages of @WebServlet correct ?
>>
>> @WebServlet("*")
>> @WebServlet("emfconsumer") // Is it ok not to have a leading '/' ?
>>
>> I was told these 2 work fine with tomcat and jboss web.Does spec allows
>> this?If yes why does glassfish doesn't allow it?I couldn't understand
>> clearly.
>>
>> Thanks
>> Sreekanth
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:dev-unsubscribe_at_glassfish.dev.java.net <mailto:dev-unsubscribe_at_glassfish.dev.java.net>
>> For additional commands, e-mail:dev-help_at_glassfish.dev.java.net <mailto:dev-help_at_glassfish.dev.java.net>
>>
>
>
>
>
> --
> Thanks,
> Sreekanth
>
>