wood burning stoves*
The moose likes Struts and the fly likes how to determine the forward? [s1] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to determine the forward? [s1]" Watch "how to determine the forward? [s1]" New topic
Author

how to determine the forward? [s1]

Sunny Gibbony
Ranch Hand

Joined: May 14, 2008
Posts: 39


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

Joined: May 05, 2008
Posts: 11
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

Joined: May 26, 2008
Posts: 6
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

Joined: May 14, 2008
Posts: 39
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to determine the forward? [s1]