File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Multiple Struts config files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple Struts config files" Watch "Multiple Struts config files" New topic
Author

Multiple Struts config files

Nikhil Gokhale
Greenhorn

Joined: Jan 24, 2011
Posts: 2
Hi,

I have two Struts config files.

<init-param>
<name>config</name>
<value>/WEB-INF/struts-config.xml</value>
</init-param>
<init-param>
<name>config/edit</name>
<value>/WEB-INF/struts-html-edit.xml</value>
</init-param>

The first one works fine i.e. config, but the second module one (edit) doesnt seem to work. The first page for edit is edit_jsp.jsp and it has following simple html form -

<html:form action="edit/edit1.do" method="POST" type="com.sample.form.ConfigureFormBean"/>

My struts-config for edit is -

<action-mappings>
<action path="/edit1" name="ConfigureBean" scope="session" type="com.sample.action.MyFirstAction">
<forward name="success" path="jsp/index.jsp"/>
</action>
</action-mappings>

But when edit_jsp.jsp is hit, it throws following error -

Looks like it is not able to lookup the edit mapping for struts config. Can anyone please help me in this ?

Caused by: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /edit/edit1
at com.ibm.struts.taglib.html.FormTag.lookup(FormTag.java:470)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
at com.ibm._jsp._edit_5F_jsp._jspx_meth_html_form_0(_edit_5F_jsp.java:123)
at com.ibm._jsp._edit_5F_jsp._jspService(_edit_5F_jsp.java:93)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

define one struts.xml file in your src and do some thing like this


Learning some thing New Every Day
Nikhil Gokhale
Greenhorn

Joined: Jan 24, 2011
Posts: 2
Yogesh Lonkar wrote:define one struts.xml file in your src and do some thing like this



Isn't above for Struts 2 (one struts file with multiple entries) ? I am using Struts 1.6 in my example above.
I hope someone must have faced similar error i did !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Struts config files