Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris


Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone pls provide some help rgding SwitchAction? I am not becoming able to work it out.I 've defined two configuartion files , namely -
1. web.xml < Code fragment >



1. struts-config.xml
path ="/switch"
type ="org.apache.struts.actions.SwitchAction">
<action path="/Login123"
parameter ="method">
<set-property property = "logResults" value = "true" />
<forward name="success"

2. Now I ve defined struts-config-admin.xml as follows-

path = "/switch"
type= "org.apache.struts.actions.SwitchAction" />

path = "/admin/login"
name = "loginBean"
type = "com.action.admin.LoginAction"
<forward name = "success" path = "/jsp/switchAction.jsp" />

Now after creating this I am not getting the output.

Anirban, Jnior member<SCJP>
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, the path to your second action in struts-config-admin.xml should be /login instead of /admin/login.

Secondly, According to Struts javadoc, when using this action you have to provide a page parameter and a prefix parameter. Are you doing this?

For example, if you're currently in the main module and you want to switch to the admin module login page, the url would be

Of course, if you're in the main module, you can also accomplish the same thing by calling admin/
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic