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 >
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/admin</param-name>
<param-value>/WEB-INF/struts-config-admin.xml</param-value>
</init-param>
1. struts-config.xml
<action-mappings>
<action
path ="/switch"
type ="org.apache.struts.actions.SwitchAction">
</action>
<action path="/Login123"
name="loginBean"
type="com.action.LoginAction"
input="/jsp/login.jsp"
scope="request"
className=
"com.customMapping.MyActionMapping"
parameter ="method">
<set-property property = "logResults" value = "true" />
<forward name="success"
path="/switch.do?page=/login.do&prefix=/admin"
/>
</action-mappings>
2. Now I ve defined struts-config-admin.xml as follows-
<action
path = "/switch"
type= "org.apache.struts.actions.SwitchAction" />
<action
path = "/admin/login"
name = "loginBean"
type = "com.action.admin.LoginAction"
>
<forward name = "success" path = "/jsp/switchAction.jsp" />
</action>
Now after creating this I am not getting the output.
Regards-
Anirban, Jnior member<
SCJP>