Hi,
Usually when we use modules in struts only your jsps related to that perticular module is seperated. All your configuration files and other classes will be in your default module.
This is a small example i did using two congig file.
I have one default module where i have login and menu page and. Apart from that i have one more module called registration where i have my register.jsp file resides. Action class related to this is mapped in a configuration file called
struts-config0reg.xml and the first classed are mapped into default configuration file .
Lets see the mapping i have done
defaultFile
=======
<struts-config>
<form-beans>
<form-bean name="loginForm" type="mypackage3.LoginFormBean"/>
</form-beans>
<action-mappings>
<action path="/login" type="mypackage3.LoginAction" name="loginForm" input="/login.jsp" scope="request">
<forward name="success" path="/menu.jsp"/>
</action>
</action-mappings>
<message-resources parameter="mypackage3.ApplicationResources"/>
</struts-config>
=====
Second config file
====
<struts-config>
<form-beans>
<form-bean name="RegFormBean" type="org.apache.struts.action.DynaActionForm" dynamic="true">
<form-property name="name" type="java.lang.String"/>
<form-property name="address" type="java.lang.String"/>
</form-bean>
</form-beans>
<action-mappings>
<action path="/save" type="mypackage2.RegAction" input="/registration.jsp">
<forward name="success" path="/display.jsp"/>
</action>
</action-mappings>
<message-resources parameter="mypackage2.ApplicationResources"/>
</struts-config>
This is the way i am mapping. Your web.xml mapping is correct.
In
www.onjava.com site they have given how to use multiple configuration file . You will get information from jakarta site also. Mainly we use
switchAction class . In onjava. com they have given how to use this class.
Hope this will help you
all the best
poornima