You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Damm, Gary" <ga...@qualcomm.com> on 2004/03/11 20:56:01 UTC

help implementing modules...

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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org