I just want to know if I figured out the use of modules and forwards correctly.
In a JSP-file /module1/index.jsp which resides within module 1 I have the following link
<html:link forward="toFormInThisModule">Go to Form</html:link>
To make this work I need the following two parts in this modules config file (struts-config-module1.xml)
<!-- a global forward -->
<global-forwards>
<forward name="toFormInThisModule"
path="/toFormInThisModule.do" />
</global-forwards> <!-- a simple action to keep the controler on track -->
<action-mappings>
<action path="/toFormInThisModule"
forward="/form.jsp"
</action-mappings>If I want to switch to another module I simply set the attribute "contextRelative" to "true" and specify the complete path, e.g.
<global-forwards>
<forward name="toFormInOtherModule"
path="/module2/toOtherForm.do"
contextRelative="true" />
</global-forwards>In the config file of module 2 (struts-config-module2.xml) I have to specify the appropriate action
<action-mappings>
<action path="/toOtherForm"
forward="/otherForm.jsp" />
</action-mappings>So I always have a forward (global or local) and a matching action. The forward only forwards to the action in the desired module (regardless of beeing the same module or any other) and the action "forwards" to the JSP file. If I try to get directly from the forward to the JSP, like
<global-forwards>
<forward name="toFormInThisModule"
path="/form.jsp"/>
</global-forwards>I always loose contact to the current module and the default module (with struts-config.xml as the config file) is taken.
Is that right?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

