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: [S2] action mapping with merely default action
Date Sun, 13 Jul 2008 20:52:07 GMT
(Whoops; wrong button.)

Depending on how your application is laid out you could also put a "catch-all" mapping at
the end of your regular mappings, like so:

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

Again, this is if you're intent on using XML configuration.

Dave

--- On Sun, 7/13/08, Pierre Thibaudeau <pierre.thibaudeau@gmail.com> wrote:

> From: Pierre Thibaudeau <pierre.thibaudeau@gmail.com>
> Subject: [S2] action mapping with merely default action
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Date: Sunday, July 13, 2008, 4:43 PM
> With Struts1, if I wished to render a JSP page without
> bothering with the
> machinery of an action (yet going through the
> filters/interceptors), I would
> have an action mapping as follows:
> 
>         <action path="/home"
> forward="/static/home.jsp" />
> 
> With Struts2, in the same situation, I would do:
> 
>         <action name="home"
> class="com.opensymphony.xwork2.ActionSupport">
>             <result>/static/home.jsp</result>
>         </action>
> 
> This is a case where Struts2 is a lot wordier than Struts1.
>  (I have to do
> this about 15 times, for the site's "static"
> pages...)
> 
> Is there a shorthand version?

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


Mime
View raw message