File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes redirect to another url using the post method 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 » JSP
Bookmark "redirect to another url using the post method" Watch "redirect to another url using the post method" New topic
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: 60810
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: redirect to another url using the post method
 
Similar Threads
servlet to servlet communication
Exception java.io.IOException: HTTPS hostname wrong:
How can i use ActionRedirect using post method
To call a servlet from another servlet
Servlet to html