how can you switch onemodule to another module by switch
action class plz explain with exapmle?

Answer Posted / m.gangadhar

hi,

let us a senario in our example we have two modules called
1.Module1
2.Module2

we have one main.jsp which is there in default module

main.jsp
--------
<html:form action="switch"?
prefix="/Module1"&page="/mod1.jsp"/>
<html:form action="switch"?
prefix="/Module2"&page="/mod2.jsp"/>
</html:form>

we have to take the struts-config.xml(default config file)
<action
type="org.apache.struts.actions.SwitchAction"
name=""
</action>

and dont forget to configure module specific configure
files in web.xml(mandatory)

<web-app>
<servlet>
<servlet-name>action</servlet-name>
<servlet-
class>org.apache.struts.action.ActionServlet</servlet-class>

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/Module1</param-name>
<param-value>/WEB-INF/struts-module1-config.xml</param-
value>
</init-param>
<init-param>
<param-name>config/Module2</param-name>
<param-value>/WEB-INF/struts-module2-config.xml</param-
value>
</init-param>
</servlet>
...
...
</web-app>


and many more but these things r very inportant and other
is asusual normal struts program.

if ur not clarified plz mail to ur problem my email id
metari.gangadhar@gmail.com

bye

Is This Answer Correct ?    31 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is struts actionmapping?

520


How do I access token?

495


What is struts2 in java?

527


What is the use of jsonvalidation in struts?

549


Is there a particularly good ide to use with struts?

504






Which library is provided by struts for form elements like check boxes, text boxes etc?

506


how to develop the submit and search operations in single jsp using struts?

2554


how to debug struts project in netbean ?

1919


What are action errors and error and what are the consequences they impose?

561


When do I need “struts.jar” on my classpath?

535


Can you give an overview of how a struts application flows?

523


What does it cost to replace struts?

497


Where can I get help with struts?

561


How to get data from the velocity page in a action class?

565


How can forward action be used to restrict a strut application to mvc?

517