abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: unit testing RegexTargetResolver
Date Tue, 09 Oct 2007 21:48:27 GMT
The Target resolver mechanism was designed specifically to allow for
multiple implementation approaches.  Having something easier than
regex's would be fantastic.

And yes, the target resolver does have a mechanism for extracting
information from the url.

- James

Jim Ancona wrote:
> Chris Berry wrote:
>> (RegExs are notoriously hard to get right, particularly when there are
>> a multitude of use cases  ;-)
> 
> I wonder if regular expressions are too powerful for this application.
> Perhaps something like  Ant paths, as used in Spring's
> SimpleUrlHandlerMapping[1] would better hit the 80/20 point?
> 
> So the example from the RegexTargetResolver javadocs would change from
> 
> tr.setPattern("/atom/([^/#?]+)/([^/#?]+)",ResourceType.ENTRY);
> 
> to
> 
> tr.setPattern("/atom/*/*",ResourceType.ENTRY);
> 
> If this sounds worthwhile, I could try putting an AntPathTargetResolver
> together.
> 
> A related question: Does Abdera provide any support for getting the
> pattern matches from the Target? (I couldn't find any.) I ran into a
> Spring extension called ParameterizedUrlHandlerMapping[2] which
> addresses a similar problem by naming the patterns so they can be
> accessed downstream.
> 
> Jim
> 
> [1] -
> http://www.springframework.org/docs/api/org/springframework/web/servlet/handler/SimpleUrlHandlerMapping.html
> 
> [2] -
> http://www.carbonfive.com/community/archives/2007/06/parameterized_rest_urls_with_spring_mvc.html
> 
> 

Mime
View raw message