• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts modules does not work!

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi every body,
Here is my situation... I have two modules in my application. We have developed default application (while ago) where we did not implement modularization. Now we have to develop another application which is going to become a module of first app. Following is the way I tried to modularize my app.
The web.xml looks like...
...
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/bb</param-name>
<param-value>/WEB-INF/struts-config-bb.xml</param-value>
</init-param>
..
The Action class...
under execute method.. {
mapping.findForward("bbModule");
}
The struts-config...
<action-mappings>
<action path="/secureLogon" type="com.LogonAction" name="secureLogonForm" scope="request">
<forward name="bbModule" path="/bb/accountSummary.do" contextRelative="true" redirect="true"></forward>
</action>
</action-mappings>
The struts-config_b....
<action-mappings>
<action path="/accountSummary"
type="com.AccountSummaryAction"
name="accountSummaryForm">
<forward name="success" path="/WEBINF/pages/bb/accountSummary/accountSummary.jsp" /> </action>
</action-mappings>
The AccountSummary class's execute method has..
return mapping.findForward("success");
Every thing works fine until I request accountSummary.jsp to display. I am developing under WSAD 5.1.1. In debug mode, I can see that I am returning from AccountSummary class (referenced in struts-config-bb.xml) with a "success" forward value. After this I will get "page can not be found" error page. The url on the browser points to correct path (http://localhost:8080/IBWS/bb/accountSummary.do). I tried to follow struts module switching example. I don't know what I am doing wrong. BTW..The "IBWS" is the root of the app. Without modules, this application is working fine. But when I want to switch between modules, I have problem.
Your help is greatly appreciated. Thank you very much.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The URL in your browser is fine. We can see that because the action it points to is returning the success forward.
The problem occurs because it can not find the jsp by the path you described.
Try path="WEB-INF/pages/bb/accountSummary/accountSummary.jsp" and let me know what happens.
[ April 27, 2004: Message edited by: Marc Peabody ]
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In my application i have more than one module. I am handlind this modules using SwitchAction .
In my default configuration file i have an action mapping for SwitchAction as follows
<action-mappings>
<action path="/switch" type="org.apache.struts.actions.SwitchAction"/>
<action path="/myPath" type="org.bas.core.myPackage.action.MyAction">
<forward name="success" path="/jsp/core/secondModule/secondpage.do"/>
</action>
i am giving the forward path to the second modules's page . You can either forward to a jsp page or to an action class according to your requirement. And mapping for the second module is as you given in your question .
Now i am swtiching the action as
<action path="/myPath" type="org.bas.core.usermanagement.action.MenuAction">
<forward name="success" path="/switch.do?prefix=/secondModule&page=/jsp/core/secondModule/loadSecondPage.do"/>
</action>
Try this way ok . In jakarta tutorial they have explained very well how the swtiching is working
Go through that also
all the best
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic