Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Struts
how to determine the forward? [s1]
Sunny Gibbony
Ranch Hand
Posts: 39
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
private ActionForward backButton (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String directive = request.getParameter("directive"); return mapping.findForward("[B]someforward[/B]");
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
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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.
These are the worst of times and these are the best of times. And this is the best tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Difference between WAS 6.0 and its previous versions
%@include file= % ?
What does the following statement means?
Having doubt in EL
directing page
More...