Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect to another url using the post method

 
shaggy lype
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64847
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shaggy lype
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use POST method instead of GET,POST method is more secure.
 
Arun Srinivasa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic