• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Forwarding through struts...help reqd.  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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:
http://abc.xyz.com?username=username&password=passwd
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.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

ActionForward externalurl = new ActionForward("http://abc.xyz.com?username=username&password=passwd",true);

return externalurl;

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

:Atchuta

[ December 28, 2005: Message edited by: Atchuta Penmatsa ]
[ December 28, 2005: Message edited by: Atchuta Penmatsa ]
 
grapes are vegan food pellets. Eat this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!