• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Converting a Get Request into Post Request

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

My Application gets loaded from a hyperlink in a portal where parameters required by my applications are sent in a query String( Get request). Now after using those parameters in my business logic, My page which gets rendered has that query String still in URL. I am using requestDispatcher to render the response. I cant use sendRedirect as i need server side response because of my application requirements.

I dont want this query string in URL as it has some sensitive data.

So i want to convert my Get Request to POST before it hits the business logic.

Is it possible? If yes than please let me know the wayout.

I do not have access to modify portal so i cant make it a POST request on initial hit.

Thanks
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Convert?

Just let the portal invoke a POST request instead of a GET request using a form.
 
Anks Gupta
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any other workaround to implement this is also welcome. Please help
 
Anks Gupta
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I have said I dont have access to Portal system. I need to handle this in my own app only.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That´s a pity.

You need to invoke a redirect after GET to get rid of the query parameters. You may consider to store the data temporarily in session and remove it after the redirect.
 
Anks Gupta
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also My Application is called through a hyperLink in portal and hyperlinks are inherently GET.
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I think you can try with filter.
I was reading filter, then came to know that you can process your request before submitting to Business Logic,
and that is also not visible to cleint or in URL.
You can work aroud filters. Maybe can help you.
Regards.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the browser sent a GET, then nothing that's done on the server will convince it otherwise, and the parameters will be shown. Filters can do nothing about this. You'll need to do a client-side redirect.
 
Anks Gupta
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bauke... Redirect worked for me
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anks Gupta wrote:Also My Application is called through a hyperLink in portal and hyperlinks are inherently GET.


Uh yes. I didn't say that you need a hyperlink for post. I mentioned about a form.

At any way, you need to invoke a redirect. That's all. To transfer variables to the redirected request, temporarily make use of the session.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anks Gupta wrote:Thanks Bauke... Redirect worked for me


Good work. You're welcome.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic