File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to determine the forward? [s1]" Watch "how to determine the forward? [s1]" New topic

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

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"

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.

Suresh Kumar

Joined: May 26, 2008
Posts: 6

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

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

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.

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:
subject: how to determine the forward? [s1]
It's not a secret anymore!