struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen Gilliland <>
Subject Re: struts2 equivalent of html:link tag?
Date Mon, 16 Apr 2007 22:21:36 GMT

Dave Newton wrote:
> --- Allen Gilliland <> wrote:
>>> <s:url value="/ui/something.jsp"/>
>> okay, but at that point there is no real reason to
>> use the s:url tag at all 
> If you're not dealing with contexts, perhaps not.
>> <html:link forward="login">login page</html:link>
>> and had this in your struts config file ...
>> <global-forwards>
>>    <forward name="login"
>> path="/ui/login-redirect.jsp"/>
>> </global-forwards>
> In S1 my impression was that it was generally
> recommended to direct all requests through actions to
> avoid problems like this; that's one reason why the
> ForwardAction and the forward attribute were
> introduced: ending up with a link to a JSP is mostly
> broken (IMO, anyway).

I agree, and I should probably fix the few places where the application 
wants to link directly to jsps.  However, in the case of my struts1 -> 
struts2 migration scenario i have a fairly valid reason for linking to 
urls outside of my struts2 actions because as i migrate in chunks i need 
the ability to link from my struts2 actions back to my struts1 actions 
and vice versa.

>> does struts2 have any equivalent for that?
> AFAIK not beyond what has already been shown.
> If you're simply dispatching to a JSP or something
> else the normal container dispatcher can handle, why
> not just add the following to your struts config?
> <action name="the/path">
>   <result>/WEB-INF/jsp/the.jsp</result>
> </action>

Ahh, I wasn't doing that because I didn't think of it :(

I have tried that out and I believe it will fit my need well enough.

Thanks for your help.

-- Allen

> d.
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message