users@jersey.java.net

Re: [Jersey] URL pattern for * ?

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Wed, 16 Sep 2009 19:17:49 +0200

so in Jersey we should never use a variable as first element of a path:

{var}/path2/path3

If we want to secure this urls...

boring :) so now I need to change my URLs to satisfy the web.xml :)



On Wed, Sep 16, 2009 at 7:10 PM, Marc Hadley <Marc.Hadley_at_sun.com> wrote:
> I think the problem is that web.xml isn't as expressive as you'd like. I
> think only a trailing * or *.something is supported. My guess is that if you
> tried:
>
> curl -v -H "Accept: application/json" -XPOST
> http://fgaucho.dyndns.org:8080/arena-http/*/homework/teste
>
> then you  might hit the auth constraint.
>
> Marc.
>
> On Sep 16, 2009, at 11:58 AM, Felipe Gaścho wrote:
>
>> @Path("{puj}/homework")
>> public class PujHomeworkResource {
>>        @POST
>>        @Path("{acronym}")
>>        public PujHomeworkEntity create(@PathParam("puj") String name,
>>                        @PathParam("acronym") String acronym) { ...... }
>> }
>>
>> what is the pattern to the method create ??
>>
>> The test curl command is something like:
>>
>> curl -v -H "Accept: application/json" -XPOST
>> http://fgaucho.dyndns.org:8080/arena-http/PUJCE-08/homework/teste
>>
>> but it passed direct.. without authentication error ...
>>
>> I tried in my web.xml
>>
>> <url-pattern>/*/homework/*</url-pattern>
>>
>> without success :(
>>
>>
>>                <web-resource-collection>
>>                        <web-resource-name>Create Homework is restricted to
>> Professors</web-resource-name>
>>                        <description />
>>                        <url-pattern>/*/homework/*</url-pattern>
>>                        <http-method>POST</http-method>
>>                </web-resource-collection>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>



-- 
Looking for a client application for this service:
http://fgaucho.dyndns.org:8080/footprint-service/wadl