| Author |
redirect to another url using the post method
|
shaggy lype
Greenhorn
Joined: Apr 02, 2004
Posts: 21
|
|
Hello Ranchers, I want to collect the username & passcode of users in my jsp & after validating thru a webservice call I want to redirect to another url(third party url)sending the values entered by the user using a post method. Since by using get method the values will be appended in the url & can be seen by the outside world which I don't want to. Thanks in advance.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
Be aware that unless you are using https, post params are visible to the outside world as well -- just not in the browser address bar.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
shaggy lype
Greenhorn
Joined: Apr 02, 2004
Posts: 21
|
|
|
Thanks Bear, but can you help me out how to redirect to another url & send those values using post method ? I assume the values will be lost when we redirect url using post method.
|
 |
Arun Srinivasa
Greenhorn
Joined: Jun 01, 2006
Posts: 3
|
|
|
use POST method instead of GET,POST method is more secure.
|
Arun Earni
|
 |
Arun Srinivasa
Greenhorn
Joined: Jun 01, 2006
Posts: 3
|
|
|
use interface request dispatcher, it receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name,then use the method forward.
|
 |
ramprasad madathil
Ranch Hand
Joined: Jan 24, 2005
Posts: 489
|
|
I dont think its possible to redirect using a RequestDispatcher. You could always forward or include however. Redirect is essentially a browser action. The response, in its header, would contain a redirect code with the redirect url. The browser reads this header and does a 'GET' request to the url. As far as I know, its not possible to force the browser to issue a post request for a redirect. ram.
|
 |
 |
|
|
subject: redirect to another url using the post method
|
|
|