Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to determine the forward? [s1]

 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Obviously where it says "someforward" I need to put my own forward there. Where can I find out the exact name of the forward? I didn't see anything that I thought I could use in the struts-config.xml

Any suggestions?
 
Terril Douglas
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I think you have to check your struts-config-main.xml

SO basically where you have the input attribute in your config file:

<action path="/TestDispatch"
type="com.jamesholmes.minihr.TestDispatchAction"
name="TestDispatchForm"
scope="request"
validate="false"
input="/TestDispatch.jsp"
parameter="function"/>

With that findForward it will go to TestDispatch.jsp. I believe this is how it works I guess someone can correct me if I am wrong hope this works.

Jamon
 
Suresh Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can find out the exact name of the forward in forward tag under the corrosponding action mapping of your struts-config.xml.

<global-forwards>
<forward name="failure" path="/failure.jsp"></forward>
</global-forwards>
<action-mappings>
<action path="/test" name="testForm" type="com.action.TestAction">
<forward name="success" path="/welcome.jsp"></forward>
<forward name="error" path="/error.jsp"></forward>
</action>
</action-mappings>

success is the forward name if you want the request to be forwarded to welcome.jsp.

If there are no forward tags under corrosponding action mapping, then global-forwards will be checked.

Hope it is helpful.

Suresh.
 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes this is very helpful! Thanks for your knowledge.

I think my issue was that I was looking at the wrong struts-config file as the project has many sub components with their own config file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic