struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: struts2 equivalent of html:link tag?
Date Mon, 16 Apr 2007 21:21:34 GMT
--- Allen Gilliland <allen.gilliland@sun.com> 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).

> 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>

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message