Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Get and Post

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I am calling the post method of the servlet with the following url
<form name=frm1 method=post action="..?aa=12&bb=13">
<input type=hidden name=hid1 value=10>
</form>
in the called servlet i am able to retrieve all the parameters how is this happening.
Also if i try to do it using get then the values are overwritten and only vaue of hidden variable is obtained.
bye
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when you 'post' data, it uses a separate stream. So both the querystring you have built in the action tag, and the posted form data will make it to the servlet.

when you 'get' data, then only a query string is sent. I have not tried it out, but from what you are saying, it appears that the querystring is overwritten by your browser, and so it ignores the querystring already written in the action tag.
 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In GET, the query string is appended to the end of the requested URL. In POST, the parameters are sent within the body of request in a urlencoded format.
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic