The uniqueness of a URL is only based on the portion of the URL up to
the first parameter (not including trailing characters not in the set
[A-Za-z0-9_]). So in this case you basically have two ActionBeans mapped
to the same URL: /foo/bar. While a literal expression is allowed at the
end of the URL, it is ignored when determining which ActionBean is being
called. The trailing literal can serve to map the URL to the Stripes
dispatcher with an extension -- in this case *.htm -- but it is not used
by clean URLs except to exclude it from the value of the last URL parameter.
The reason it is this way is that a clean URL can be truncated to
include any number of the parameters and literals declared in the URL
binding (in order, of course). To try to match on both the leading and
trailing literal portions of the URL binding would break that behavior.
We can't say that a trailing literal has to be present in order for it
to match and at the same time allow any number of literals and
parameters to be absent from the end of the URL.
Hopefully this clarifies things a little.
-Ben
Kai Grabfelder wrote:
Hi there,
I have an issue with the current implementation of SEO friendly urls in the
trunk. Assume the following two Action Bean Urls:
@UrlBinding(value = "/foo/bar/{id}/fileName.htm")
private class SimpleUrl3 implements ActionBean{}
@UrlBinding(value = "/foo/bar/{id}/fileName2.htm")
private class SimpleUrl4 implements ActionBeanActionBean{}
When I now use the link tag to link to any of the action Beans the result is
unpredicable. It happens that links to:
<stripes:link beanclass="SimpleUrl4"><stripes:param name="id" value="${id}"
/>link</stripes:link>
results in the following url /foo/bar/id/fileName.htm (which is the url of
SimpleUrl3 not SimpleUrl4).
See the attached testcase (jUnit, I never used TestNG before...): the url,
returned by AnnotatedClassActionResolver is always the
same for SimpleUrl3 and SimpleUrl4. So I guess we need some changes in how the
UrlBindingFactory returns the url and in how the
LinkTagSupport constructs the complete urls...
Any proposals on how to changes this?
btw: It would be no problem for me to check my testcase into SVN, if I only had
commit rights ;-)
Regards
Kai
------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development