You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Hess <gh...@wrappedapps.com> on 2002/08/26 19:03:37 UTC

Switch Action example

Hi All,

I am having trouble using the SwitchAction and all the threads in the
Archives dont actualy provide an example of its use and claim that it may
not work?

Could anyone provide an example of its use.

Thanks for your time,

Greg

Re: Switch Action example

Posted by Marco Maier <Ma...@ics-software.de>.
Hi Greg,

here is an example...

<exception
key="global.error.httpSessionTimeout"
path="/switch.do?prefix=&amp;page=/login.jsp"
scope="request"
type="de.ics_software.rpk.struts.exception.HttpSessionTimeoutException"/>

<action-mappings>
<action 
path="/switch" type="org.apache.struts.actions.SwitchAction" />
</action-mappings>

The prefix request parameter specifies the application prefix.
In my example I switch to the default application.
If you want switch to the e.g. struts-cars-confix.xml sub-appplication, 
the prefix must be /cars.
BTW use &amp; instead of & in your request past, since & confuses the
XML Parser.

Hope this helps.

Marco

Greg Hess wrote:
> Hi All,
> 
> I am having trouble using the SwitchAction and all the threads in the
> Archives dont actualy provide an example of its use and claim that it may
> not work?
> 
> Could anyone provide an example of its use.
> 
> Thanks for your time,
> 
> Greg
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>