[ 
http://www.stripesframework.org/jira/browse/STS-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11450#action_11450
 ] 

Andrew Jaquith commented on STS-262:
------------------------------------

Ben,

I've found an issue in build 947 with the implementation of clean URLs, which 
relates to differences in how the ActionResolver and UrlBuilder handle appended 
parameters.

With a given "clean" @UrlPattern, if parameters otherwise unspecified in the 
pattern are added to the UrlBuilder, they are properly appended in the 
generated URL. But if that generated URL is passed back to the StripesFilter, 
the trailing parameters are not parsed as expected, even if the ActionBean has 
properties that those parameters "should" bind do. In other words, it is not a 
"round trip" operation.

Example: suppose we have an ActionBean with 
@UrlBinding("/cleanbean1/{param1=Test}/?do={$event}"). It has three properties, 
param1, param2 and param3 and two events (view, edit). Suppose we create an 
UrlBuilder for the bean; specify an event of "edit"; and add parameter values 
for the three properties (param1=Godel, param2= Escher, param3= Bach). We get a 
properly built URL, with param2 and param3 appended after the clean URL 
portion, e.g.:

"/cleanbean2/Godel/?do=edit&param2=Escher&param3=Bach" 

However, passing that URL back into the StripesFilter via MockRoundTrip results 
in the trailing parameters not being parsed:

param1=Godel, param2=null, param3=null

I've looked into this a little bit further, and it seems that the 
MergedParameterMap feels that "edit&param2=Escher&param3" is the extracted 
parameter and that its value should be "Bach". That's probably not the root of 
the issue, but it does suggest that trailing parameters for clean URLs aren't 
being parsed.

This might be "by design," -- but it feels kinda asymmetrical. Can this be 
fixed?

I  have a TestNG class that tests several edge cases, if that's helpful.
   

> Friendly URL support
> --------------------
>
>                 Key: STS-262
>                 URL: http://www.stripesframework.org/jira/browse/STS-262
>             Project: Stripes
>          Issue Type: New Feature
>          Components: ActionBean Dispatching
>            Reporter: Tim Fennell
>            Assignee: Ben Gunter
>             Fix For: Release 1.5
>
>         Attachments: cleanurls-patches.zip, cleanurls-src-01182007.zip
>
>
> One thing that comes up frequently is support for friendly URLs, e.g.:
>   /blog/2006/08/22
>   /user/6282/edit
> and so on.  While it's possible to acheive URLs like this using 3rd party 
> tools like UrlRewriteFilter it would be nice if they were built directly into 
> stripes because then all URL information could be kept in a single place for 
> each class.
> I'm envisaging an annotation something like this:
>     @UrlInfo("/{year}/{month}/{day}")
>     @UrlInfo("/{userId}/{event}")
> that would inform Stripes how to map the extra pieces of information encoded 
> in the URL.
> Optionally this could also be specified with the existing UrlBinding 
> annotations, e.g.
>     @UrlBinding("/blog/{year}/{month}/{day}")
> If done right, the stripes url and link tags could also take advantage of 
> this information to put certain parameters into the URL instead of a 
> parameter string.
> I'm very open to hearing alternative ideas around how to specify this, and 
> other functionality that would be desirable.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to