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



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

Answer / 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

More Struts Interview Questions

What configuration files are used in struts?

0 Answers  


What do you mean by actionform?

0 Answers  


What are the important methods of actionform?

0 Answers  


explain the Struts flow?

4 Answers   Wipro,


What is the purpose of @result annotation?

0 Answers  






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

0 Answers  


what is diffrence between Dynaactionform,actionform and Dynavalidateform

8 Answers   TCS,


Please can you tell me ,where can we used the MVC other than web applications.

1 Answers  


How to use forward action to restrict a strut application to mvc?

0 Answers  


What are Struts properties?

2 Answers   VI eTrans,


we have 7 jsp pages .At last page we have a submit button when we click it it will store all jsps data which we provide will store into database. when we starting providing data in jsp pages when we are at 3rd jsp at that time sessions timeout where the data will be store which we r provide in last two jsps?

2 Answers  


Can we have different controllers in one struts app?

7 Answers   Accenture,


Categories