Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hide parameter while redirecting to external resource  RSS feed

 
sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I need to redirect from my jsp to some external resource(external url) with some parameter. But I need to hide these parameter from being displayed in the URL.
How could I achieve this? is it possible to redirect using POST method so that request parameter not getting displayed ?
Any suggestions are truly appreciated

-Thanks
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sujith Acharya wrote: is it possible to redirect using POST method so that request parameter not getting displayed ?


Nop. since session cant be shared between two applications . you need to encode your url and then redirect .

hope this helps
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. Capture the request information in a dynamically created form with a method of "POST" and cause it to be immediately submitted using JavaScript.
 
sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by dynamic form? and can you explain how we can set the request as "POST" while redirecting?
Could you explain more on this.

-Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a JSP that will set up a hidden form with all the parameters you need, set the action to the redirect URL, and method to post. Then submit it automatically. You have all the information you need in the request.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!