954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Redirect/forward form to another host

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
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

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

sumit_indian
Newbie Poster
10 posts since Jun 2007
Reputation Points: 6
Solved Threads: 1
 

idiot. Sessions do NOT get shared between applications.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You