dcsimg
How do you forward to an external URL determined during an Action?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tim_Hoffman
Posted On:   Sunday, January 25, 2004 05:48 PM

During the Action.execute method, the location of the external URL is pulled from a database. Returning an ActionForward using the external URL results the external address being appended to the end of the webapp. Is there a way to redirect to an external address?

Thanks

Re: How do you forward to an external URL determined during an Action?

Posted By:   Anonymous  
Posted On:   Monday, January 26, 2004 04:41 AM

You can redirect to the URL by yourself (using response.sendRedirect) and return null in your execute()-method. A small example:




...
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

String externalURL = "http://www.jguru.com/";
response.sendRedirect(externalURL);
return null;
}
...
About | Sitemap | Contact