This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Please help me clarify the following questions if you can ---
1. I know doGet()'s limit is the length of query string. e.g if a user picks 5 hundred products from your product list, your server may not be able to sustain the query string length ? so, this length limit is server specific, right ?
2. can I pass and retrieve hidden variables using doPost() ?
I can access the Query String parameter with doPost() method additional to the parameters supplied through HTML FORM. Why it is not true for the doGet() method. If I use doGet() method for the URL containing Query String and the FORM parameters, the query string is ignored. Why???
The querystring is not ignored when you use doGet.
Browsers send 2 types of request (there are others but they're not commonly used by browsers) GET and POST.
GET requests send only headers. Parameters can be tacked onto the end of the URL. The values can only ever be text.
A typical get request (no querystring parameters);
A POST request is a little more involved. The headers are sent and then (if the server accepts it) the content of the post is sent up. The browser must send headers telling the server what the content type is and what it's length is.
A typical post: The content comes after the headers...
In both cases the servlet container will look for query string parameters in the url. If the request is of type "POST" then the container will also look to see if the Content-Type is "application/x-www-form-urlencoded" and, if so, parse the content to pull the name=value pairs.
Technical differences aside, it's worth digging into the original intent for GET and POST (and the other commands.) Drastically abbreviated: GET should never modify any state, POST should submit data for update. Review the W3C description of the commands or Google for "rest architecture" or "restful architecture" for more details.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Dec 04, 2004
Your GET request headers showing 2 JSESSIONIDs. Can one request have simultenious 2 sessions?