struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kishore Senji <kse...@gmail.com>
Subject Re: is an action path attribute with periods ok?
Date Wed, 28 Jul 2004 14:05:49 GMT
<html:link> tag uses RequestUtils's getActionMappingName(String
action). The getActionMappingName(String action),
if it finds a '.' in the action, it assumes that we also supplied the
extension(.do) to the path (for eg; /login.do) and
so it removes the extension and later appends the extension stored in
the servlet context under SERVLET_KEY while rendering
the complete url. In your case, since your action is a.b.c, since it
found a '.' it assumes that you supplied an extension
for your action an so it removed everything after the last '.'. So, to
get around this problem, supply the extension to your action, so,
if you give your action to be <html:link action="/a.b.c.do">a b c test
link</html:link>, then it should work.

IMHO, You might want to think about Modules, instead of using the '.'
in your action paths.

Thanks,
Kishore Senji.


On Wed, 28 Jul 2004 19:34:55 +1000, Jurn Ho <jurn@magicmonster.com> wrote:
> Hi Everyone,
> 
> I've been experimenting with Struts, and have got up to the stage where I'm
> using the 'html' taglib to create a link to my action classes, but when
> I've got periods in my action paths it doesn't seem to create the correct url
> e.g.
> 
> in my test.jsp:
> <html:link action="/a.b.c">a b c test link</html:link>
> 
> in my web.xml the servlet mapping is *.do
> 
> and in my struts-config.xml:
> 
>     <action path="/a.b.c"
>             type="com.magicmonster.test.UserAction">
>       <forward name="Success" path="/WEB-INF/admin/user_list.jsp"
> redirect="false"/>
>     </action>
> 
> when I see my created page, it has
> <a href="a.b.do">a b c test link</a>
> but I expected
> <a href="a.b.c.do">a b c test link</a>
> 
> Has anyone experienced this problem before..?
> maybe it has something with *.do servlet mapping?
> 
> The reason I had a.b.c was to separate different sections of my application,
> If I replace the periods in the action path attribute with '/',  then it
> works as expected.
> I might try Modules as this seems to be proper way to do it.
> 
> any feedback/suggestions are welcome,
> 
> thanks,
> Jurn
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message