• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL rewriting with method POST

 
Bob Thele
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand the process of URL encoding quite clearly but need clarification on the following.
For a HTTP GET request the jsessionid parameter is appended to the URL.
What do you do for a HTTP POST request? Is it possible to use URL rewriting with POST requests?
Do you a) encode the ACTION attribute on the FORM tag OR b) include a hidden field on the form called jsessionid and give it the value of request.getsession(false).getId()?
I can't find any detailed information in any of my texts and the servlet 2.3 specification doesn't clarify this.
Can anyone clarify this for me?
Rob
SJCP2
SCWCD
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I recall, URLrewriting works the same for GET and POST. The servlet engine will grab parameters from both the URL and the POSTed data transparently to the programmer.
Give it a try.
Bill
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely don't put a hidden form field called jsessionid.

Your container *may* implement the POST URL re-writing in this way (iPlanet comes to mind, even though they call their gxsessionid), and if you have one already in there, it will confuse the container.
 
Bob Thele
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your input on this.
I have tried a few examples out & have ascertained that encoding the ACTION form attribute is the way to go.
The hidden field method failed completely.
Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic