This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes Forwarding through reqd. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Forwarding through reqd." Watch "Forwarding through reqd." New topic

Forwarding through reqd.

Tejas Gokhale

Joined: Nov 21, 2005
Posts: 24
I want to fwd. the client to another internetsite with URL rewritten i.e.
When I clikc on a hyperlink i need to find out his username and password from session and append to url like following:
and redirect to above link.

Now if I programatically append the action forward the problem is that action forwards take only context relative paths.

Any solution to this...
please help.

Regards, Tejas Gokhale
SCJP 1.4
Atchuta Penmatsa

Joined: Feb 15, 2002
Posts: 6

In Struts action class, wrap the URL in an ActionForward and set redirect-flag to "true" as shown below:

ActionForward externalurl = new ActionForward("",true);

return externalurl;

Never include a password in a link. Think of a better alternative.


[ December 28, 2005: Message edited by: Atchuta Penmatsa ]
[ December 28, 2005: Message edited by: Atchuta Penmatsa ]
I agree. Here's the link:
subject: Forwarding through reqd.
It's not a secret anymore!