ActionForward: Redirect to action/page at different domain.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ActionForward: Redirect to action/page at different domain.

  1. #1
    Join Date
    Jun 2005
    Posts
    2

    ActionForward: Redirect to action/page at different domain.

    Hello.

    How do I change the domain from current to another one when redirecting using ActionForward? I have an action class that in some conditions should redirect to an application located at a different domain. Normally I am at http://www.domain1.com and do the following:

    Code:
    ActionForward fwd = new ActionForward();
    fwd.setPath("/actions/load.do");
    fwd.setRedirect(true);

    Now being at domain1.com I have to do something like that:

    Code:
    ActionForward fwd = new ActionForward();
    fwd.setPath("http://www.domain2.com/actions/load.do");
    fwd.setRedirect(true);

    However when run it, I am redirected to
    http://www.domain1.com/http://www.do...ctions/load.do

    So to repeat the question, how do I make it go to domain2 from domain1?

    UPD: I've been told to play with setContextRelative(false); It didn't help. Tried false, tried true, nothing.

  2. #2
    Join Date
    Dec 2003
    Location
    tx/us
    Posts
    131
    Define it as a forward in the struts config and forward with a mapping.findForward("xxx"). The struts config entry will be similar to:
    Code:
    <forward
                name="failure"
                path="http://google.com"
                redirect="true" />

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center