943,801 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 2119
  • JSP RSS
Apr 15th, 2008
0

Redirect/forward form to another host

Expand Post »
Maybe a dumb question but is there a way to redirect/forward a form (and all it's parameters) to another host using jsp? Like this http://www.xxx.com/form.jsp -> http://www.xxx.com/redirect.jsp -> http://www.yyy.com/response.jsp

I've tried with sendRedirect which doesn't pass along the parameters and forward that for some reason doesn't seem to work with an external host.

Thanks,
tte
tte
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tte is offline Offline
2 posts
since Apr 2008
Apr 15th, 2008
0

Re: Redirect/forward form to another host

redirect works, forward won't work.

But of course the HTTP session does NOT get shared.
And quite possibly you'll need to make sure you're working with POST requests so and change the request parameters to request attributes.

Remember that nothing except what ends up in the http request gets send across.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Apr 15th, 2008
0

Re: Redirect/forward form to another host

Forward won't work given that the requested servlet is looked for in the given ServletContext. sendRedirect doesn't preserve the original request since it's a new request altogether which the client is making -- sendRedirect is basically an indication to the client to request for the given URI.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Apr 16th, 2008
-1

Re: Redirect/forward form to another host

why don't you sessions then if really want to use send.redirect option otherwise you can use form action method in using html that work fine with jsp
Reputation Points: 6
Solved Threads: 1
Newbie Poster
sumit_indian is offline Offline
9 posts
since Jun 2007
Apr 16th, 2008
0

Re: Redirect/forward form to another host

idiot. Sessions do NOT get shared between applications.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: save textbox value in session variable
Next Thread in JSP Forum Timeline: Registration Problem using Jsp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC