I am creating a sample application Sample.ear containing
Commons.jar,HelloWorld.jar,HelloWorld1.war and HelloWorld2.war and the
application.xml in the META-INF directory in an exploded .ear directory. My
This application represents what I want to do. Currently I have all the
applications packaged as one war and one module. So app1 can use the
pages/actions developed in app2 without much problems. This however created
a huge struts-config.xml and made development in teams difficult. Now we want
to split this one big war into multiple web applications. When doing this I
realized that we have to use something like switching modules functionality in
1.1.
So I am trying out this sample. This sample uses input.jsp to get a name and
send this information to an ejb and ejb decides if the given person is a member
or a non member(hard coded). Once the ejb gets back to the action with a
Boolean value the action object forwards it to a member.jsp(which is in
helloworld1.war) or to nonmember.jsp(which is in helloworld2). However I run
into a problem with running this sample. If the given name is a member then
member.jsp is displayed. When the given name is not a member it fails to pick
up nonmember.jsp from the other war. I followed the instructions given in the
guide and I am using a local forward to make this happen.
HelloWorld1.war has the following struts-config.xml.
<action path ="/helloworld" type ="HelloWorldAction" name ="helloForm"
scope="request" input="/jsp/input.jsp">
<forward name="member" path="/jsp/member.jsp"/>
<forward name="nonmember"
contextRelative="true"
path="/helloworld2/jsp/nonmember.jsp"
redirect="true"/>
</action>
I also added the following lines in the web.xml
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/helloworld2</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
My Helloworld2.war has a /jsp directory with the nonmember.jsp and the context
is named helloworld2.
I would appreciate if any one can help me solve the mystery (or my
stupidity...:)) here.
Note: I am using struts 1.1.
Thanks