This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Forwarding to external site Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Forwarding to external site" Watch "Forwarding to external site" New topic

Forwarding to external site

Anurag Saxena

Joined: Oct 29, 2002
Posts: 13
My servlet need to forward users to an external site with some value that will be passed along (e.g.,
I can't use request dispatcher since this is an external site. If I create a URL object and use URLConnection.connect()I have following quetions:
(1) Can I use same URL connection objects for all the users?
(2) if yes, how am I going to set the values (val1 and val2) for different users?
(3) Once I redirect the user to that external site I am done with that user, Do I need to do any thing different?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60810

What prevents you from doing a simple redirect?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jai Sund

Joined: May 31, 2002
Posts: 9
What Bear is suggesting is to use
inside your servlet's service or doXXX() method.
I agree. Here's the link:
subject: Forwarding to external site
Similar Threads
Rendered property doubt
Getting problem while redirecting the URL
Setting values using jdbc appender log4j
Table with Scrollbar
How can I get the URL of request?