Thanks, this is the best explanation I've read so far on switching modules.
One issue I have with this. In my applications I always have an application specific BaseAction that all of my Action classes extend from. This is to enforce my business rules on every request. I do not use generic/predefined Actions. When I have found the need for the functionality of the predefined actions (Success, Dispatch, Switch, etc) I've reimplemented them so they extend my BaseAction. What I would like to see, and this is targeted to the community in general, is a way to use these generic behaviors without having to bypass my BaseAction or reimplement them. Maybe as helper classes that I call from my actions. There are several ways to solve this and I just thought I should put it out there to see if others have experienced the same issues and have some other solutions. > -----Original Message----- > From: Srikanth Shenoy [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 11, 2004 7:30 PM > To: [EMAIL PROTECTED] > Subject: Re: help implementing modules... > > Hi Gary, > > I would suggest download the following free chapter from my book - > Struts Survival Guide. > Go to http://www.objectsource.com and find the link there to download > Chapter 4. > It tells you how to setup and use modules. > > Hope that helps, > > Srikanth Shenoy > Author > Struts Survival Guide: Basics to Best Practices > <http://www.objectsource.com/strutsbook.html> > J2EE Project Survival Guide > <http://www.theserverside.com/books/review/J2EESurvivalGuide.tss> > > > "Damm, Gary" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > I've successfully used Struts for several applications and have been > very happy with it. I am getting ready to use it for a larger project > and would like to use modules but I'm having some problems. > > It appears that when I attempt to switch from the default module to a > new module (module1) it never actually recognizes the new module. When > I attempt to go to a page in the new module that references an action > that is defined in the new module action mappings I consistently get the > following error. I have looked through the documentation and browsed > the list archive and still can not figure out what I'm doing wrong. Any > help appreciated. > > Also, if anyone knows a good book that documents modules well I'd like > to know (Struts In Action and Jakarta Struts have little information on > modules). > > The error: > ... > [2004/03/11 11:23:07] Cannot retrieve mapping for action /DomainSearch > javax.servlet.jsp.JspException: Cannot retrieve mapping for action > /DomainSearch > at > org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810) > at > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506) > at > org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324) > at _module1._home__jsp._jspService(_home__jsp.java:448) > ... > > Here is my web.xml where I define the module: > > ... > <init-param id="InitParam_4"> > <param-name>config/module1</param-name> > <param-value>/WEB-INF/struts-config-module1.xml</param-value> > </init-param> > ... > > Here is my forward to the page in module1: > ... > <action > path="/Module1HomeLink" > type="com.qualcomm.bds.struts.SampleAppSuccessAction" > unknown="false" > validate="false" > > > <forward > name="success" > path="/module1/Home.jsp" > contextRelative="true" > redirect="true" /> > > </action> > ... > > Here is my link on the originating jsp (in default module): > ... > <html-el:link action="Module1HomeLink"><bean:message > key="label.module1"/></html-el:link> > ... > > Here is the form in the new module that references the action: ... > <html-el:form action="DomainSearch"> ... > > Here is the action in the module1 config file: > ... > <action > path="/DomainSearch" > name="SearchForm" > type="com.qualcomm.bds.struts.SampleAppSearchAction" > unknown="false" > validate="true" > input="/module1/Home.jsp" > > > <forward > name="success" > path="/module1/List.jsp" > contextRelative="true" /> > > <exception > key="errors.generic" > type="java.lang.Exception"/> > > </action> > ... > ---------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]