Redirect/forward form to another host

Reply

Join Date: Apr 2008
Posts: 2
Reputation: tte is an unknown quantity at this point 
Solved Threads: 0
tte tte is offline Offline
Newbie Poster

Redirect/forward form to another host

 
0
  #1
Apr 15th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Redirect/forward form to another host

 
0
  #2
Apr 15th, 2008
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,617
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 466
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Redirect/forward form to another host

 
0
  #3
Apr 15th, 2008
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.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 9
Reputation: sumit_indian has a little shameless behaviour in the past 
Solved Threads: 1
sumit_indian sumit_indian is offline Offline
Newbie Poster

Re: Redirect/forward form to another host

 
-1
  #4
Apr 16th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Redirect/forward form to another host

 
0
  #5
Apr 16th, 2008
idiot. Sessions do NOT get shared between applications.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JSP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC