Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts error : Cannot get request dispatcher for path

 
Adrian Ronayne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to display a jsp form page usings struts but its not working.

Here is my jsp:
<html:form action="GDAddNewSimpleTextValue">
<jsp:include page="/WEB-INF/pages/newpage.jsp" flush="true" />
</html:form>

The corresponding entry in my struts-config.xml:
<action path="/addValue" type="com.sita.ats.revint.webcfg.action.myAction"
name="myForm"
scope="request"
validate="false"
input="inputForm">
<forward name="displayPage" path="inputForm" />
</action>

Im trying to display the page using:
mapping.findForward("displayPage");

But im receiving the error:
2006-11-22 16:25:21 - Ctx(/dld) : Status code:500 request:R( /dld + /addValue.do + null) msg:Cannot get request dispatcher for path
inputForm

Thanks for any help
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The input attribute in an action mapping tells struts where to go if there is a validation problem. It must be an actual URL such as "/WEB-INF/pages/myPage.jsp". The path attribute of a forward must also be a URL. The entry "inputForm" in both of these places in your example is not valid.
[ November 22, 2006: Message edited by: Merrill Higginson ]
 
Adrian Ronayne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a million, that worked.

But how come the other entries in the struts-config file (which were not written by me) do not require the actual path to the jsp file?

Thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic