That certainly isn't what I would expect to happen, but it does not appear
to be the fault of Stripes. I set up an ActionBean like you describe in a
test app and got the same results you did. When I hooked up a debugger to
look at UrlBindingFactory.getBinding(..), I stepped into
HttpUtil.getRequestedPath(..) and found that the value returned by
request.getServletPath() is not "/web/article////add" but "/web/article/add".
It seems the servlet container does us a "favor" by collapsing multiple
slashes in the path to a single one.
One might be inclined to use request.getRequestURI() instead, but that
causes even bigger problems. See here for a little bit of history:
http://www.stripesframework.org/jira/browse/STS-575
<http://www.stripesframework.org/jira/browse/STS-575>I'm not sure there's
much we can do about this.
-Ben
On Sat, Nov 20, 2010 at 6:17 PM, Nikolaos Giannopoulos <
nikol...@brightminds.org> wrote:
> Hi,
>
> If I have the following Url binding were each of the 1st 3 fields are not
> required:
> @UrlBinding("*/article/*{authorId}/{id}/{titleUrlified}/{$event}")
>
> And try the following Url:
> /web/article///add
>
> Clearly the "add" handler gets triggered but then something bizarre happens.
>
> The values that are assigned are:
> authorId = 'add'
> id = null
> titleUrlified = null
>
> However I expected the following assignment:
> authorId = null
> id = null
> titleUrlified = null
>
> It appears that although Stripes is able to correctly bind the appropriate
> fields of the @UrlBinding for the incoming request it doesn't fulfill that
> when assigning the values to the attributes of the ActionBean...
>
> It's as if it says well what do we need to assign 1st?
> Umm.... authorId... ok what's the 1st value we have... 'add'... great...
> NO... 'add' is bound to the "event"!!!
>
> It should be we just did this:
> 1. authorId was not required and had no value hence its assigned null
> 2. id was not required and had no value hence its assigned null
> 3. titleUrlified was not required and had no value hence its assigned null
> 4. and event is assigned 'add'
>
> Is this not a bug?
>
> --Nikolaos
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users