This is a discussion on Struts Question: Redirecting to a URL within the Java Tutorials forums, part of the Articles and Tutorials category; I am trying to use the mapping.findforward() method to redirect the control to a URL like http://www.yahoo....
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Struts Question: Redirecting to a URL
I am trying to use the
mapping.findforward() method to redirect the control to a URL like http://www.yahoo.com I declared a action forward tag in struts-config.xml but for some reason, when I use the execute method (Struts 1.1) it doesn\'t work. When I use the perform method (Struts 1.0), it works! Is there a way to make this work? All i want to know is whether I can turn-off \"ContextRelative\" field (Its inherited from Class ForwardConfig from which ActionForward is derived! Preferred behavior is -> As soon as a user enters, via a link, he/she is sent to a Servlet (Having just one Action Class called callingServlet.java). The action class basically looks for the user id in session and if it is not available, redirects control to another page outside (say http://www.yahoo.com/findme.jsp?retu...lingServlet.do) This works fine if findme.jsp is within the WebApp context. But it doesn\'t work when I try to redirect to www.yahoo.com. I am using WSAD 5.0. Also, is there a way to update the Struts plugin on WSAD to nightly build release of Struts from Apache? AND NICE JOB by ExForsys for making the Books available. Helped me a lot! Thanks.. |
|
|||
|
Re:Struts Question: Redirecting to a URL
Quote:
Check your struts version in WSAD. I guess it is 1.0, so execute() method is not working. So change to version Struts 1.1 and try. Quote:
In the Project Navigator of WSAD, select a (web) project name, right-click the name, and click Properties. On the Properties page, click Web Project Features, check the Add Struts support box, and click Apply. If you want to override the default Struts settings, on the Struts Settings page click the Override default settings box. To specify a different version, select from the \"Struts version\" drop-down menu. This determines which .jar and .tld files will be copied to the workspace: those for Struts 1.1 (default) or those for Struts 1.0.2. Click Finish. Note: Whatever version of Struts you select for your project becomes the default for your subsequent Struts projects. |
|
|||
|
Re:Struts Question: Redirecting to a URL
It still doesn\'t work!
I was able to change the Struts Version! But one thing I know for sure is that the perform() method is able to redirect a forward with a full qualified URL path like http://www.yahoo.ciom whereas the execute() does not! I don\'t know why! There were others who asked the same question, but did not reply, so for now I am stuck with this problem or I have to use logic/jsp tags. ![]() |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kerberos FAQ, v2.0 (last modified 8/18/2000) | Ken Hornstein | Tech FAQ | 0 | 10-19-2005 12:38 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 10-01-2004 06:00 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 07-03-2004 07:27 PM |