users@jsr311.java.net

RE: Re: Selecting between method candidates

From: Beryozkin, Sergey <Sergey.Beryozkin_at_iona.com>
Date: Wed, 21 May 2008 10:12:41 -0400

Yes, I agree, I'd just like to get the confirmation that
"Descending order of a number of capturing groups" sorting criteria is
there
to address this kind of scenario.

So if have a 'greedy' SubResource2 locator which handles all /{var}/*
requests, then does it mean that there's no way to ensure that some
other subresource locators can get involved in handling /{var}/*
requests, possibly with different HTTP methods ? It's not a specific
issue I'm trying to sort out, but just curious

Same question applies to selection of root resources. If we have a
'greedy'
root resource then it will basically catch all the requests matching a
specific pattern. So probably it only makes sense to have multiple root
resources/sublocators on a given resource class for different @Paths
only then...

Cheers, Sergey


 
> I've got another quesion though. "Descending order of a number of
> capturing groups" in bullet 2. My understanding it's mostly there to
> address the selection between multiple subresource locators, right ?
> Anyway, here's a concrete question :
>
> Parh("/")
> class Bar {
> @Path("/{bar}") SubResource1 a();
> @Path("/{bar}/{foo}") SubResource2 b();
> }
>
> class SubResource1 {
> @Path("/sub1") @GET a();
> }
>
> class SubResource2 {
> @Path("/sub2") @GET a();
> }
>
> Now, if we rely on a "Descending order of a number of capturing
groups"
> then a request like
>
> /1/sub1 is matched against b().
>
> is it expected ? If yes then how to ensure a request is delegated to a

> SubResource1.a() in this case ?
>

IMO, b() would be matched always because Locator's are supposed to be
dynamically processed/dispatched per request.

Bill

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
For additional commands, e-mail: users-help_at_jsr311.dev.java.net
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland