You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pb...@apache.org> on 2012/07/06 03:28:20 UTC

S2 equivalent of ForwardAction?

In Struts 1, I could use a ForwardAction (or forward attribute) to go
directly to a JSP page. The controller activates and the page renders.

Is there any such shortcut in S2? It would be nice if such a thing existed like:
<action name="gopage">
  <result name="success">/page.jsp</result>
</action>

Thanks,
Paul

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


Re: S2 equivalent of ForwardAction?

Posted by Oscar Alvarez <oi...@gmail.com>.
You can use wildcard too.

Something like this:

<action name="go*">
 <result>/{*}.jsp</result>
</action>

This takes advantage of  ActionSupport and take the default result
(success) to your page.


2012/7/6 Łukasz Lenart <lu...@googlemail.com>

> 2012/7/6 Paul Benedict <pb...@apache.org>:
> > Is there any such shortcut in S2? It would be nice if such a thing
> existed like:
> > <action name="gopage">
> >   <result name="success">/page.jsp</result>
> > </action>
>
> It should work, as a default action class is the ActionSupport class
> and its execute() method returns SUCCESS.
>
>
> Regards
> --
> Łukasz
> mobile +48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Atentamente
Óscar

Re: S2 equivalent of ForwardAction?

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/7/6 Paul Benedict <pb...@apache.org>:
> Is there any such shortcut in S2? It would be nice if such a thing existed like:
> <action name="gopage">
>   <result name="success">/page.jsp</result>
> </action>

It should work, as a default action class is the ActionSupport class
and its execute() method returns SUCCESS.


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: S2 equivalent of ForwardAction?

Posted by Dave Newton <da...@gmail.com>.
Such a thing does exist, just don't name a class :)

Dave

(pardon brevity, typos, and top-quoting; on cell)
On Jul 5, 2012 8:28 PM, "Paul Benedict" <pb...@apache.org> wrote:

> In Struts 1, I could use a ForwardAction (or forward attribute) to go
> directly to a JSP page. The controller activates and the page renders.
>
> Is there any such shortcut in S2? It would be nice if such a thing existed
> like:
> <action name="gopage">
>   <result name="success">/page.jsp</result>
> </action>
>
> Thanks,
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>