DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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" />

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links