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

inputForward="true" not working

 
krishnamurthy bomma
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on web application which uses struts and tiles.
The problem i am facing is, controller is not forwarding to the page which i specified in the input attribute of the action tag. i am sepcifying local tiles name as the input attribute instead of relative jsp path.

I have specified inputForward="true" attribute in controller tag. For some reason struts is not evaluating actual URL from input attribute of the action element.

I really appreciate any kind of help in this regard.

Below is my struts configuration (spefic parts of my struts-config.xml)


<action path="/transferFunds" type="com.mycompany.controller.TransferAction" parameter="method" name="transferForm" scope="request" input="form">
<forward name="form" path="client.form"/>
<forward name="verify" path="client.verification" />
<forward name="confirm" path="cient.confirmation" />
</action>

<controller processorClass="com.mycompany.SecureRequestProcessor" nocache="true" inputForward="true" />

I am getting below exception message.

SEVERE: Servlet.service() for servlet action threw exception
java.lang.IllegalArgumentException: Path form does not start with a "/" character
at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:368)
at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:196)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1078)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 
Saji T.Sathian
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing the same problem and unable to solve.If you could solve it by now , please post a replay.

Thanks
Saji T Sathian
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the JSP page where you call this Action class. On which JSP page you are getting this error ?
 
Saji T.Sathian
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This kind of problem comes only when multiple modules are involved.Otherwise everything works fine.Jsp s generally contains a form and submited to an action(TransferAction) in the same module ,but the control will be transfered to a processing action in a different module through a switchAction.And during the processing if error comes the control would be forwarded back to the same JSP(in the initial module)
using 'input' attribute of the Action Element(Of processing Action).
Then all the problems appear.It throws the exceptions mentioned in the
previous posts.

This problem I faced while using Struts 1.1 . With out getting any solution I changed the way of implementation.

Saji T Sathian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic