View Single Post

  #1 (permalink)  
Old 08-13-2004, 04:54 PM
akpraveen
Guest
 
Posts: n/a
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..
Reply With Quote