when my code went undergone review the comments said that usage of doGet( has to be minimum. I know that doGet has to be used when we need to retrive some data from database (which is not confidential).Otherwise use doPost. Can some body guide me when to use doGet or doPost ? When I passing data from HTML(Browser) to a Servelet(Server),in building the messages which one will tak more time ?
Dorj Galaa
Ranch Hand
Joined: May 29, 2001
Posts: 113
posted
0
get method pass query string post method pass form data
"GET" is useful for short requests. It's the older of the two forms and is convenient because it's actually displayed in the "Location" textbox on your web browser, so you can tweak it. "POST" is better for long requests, requests where you don't WANT the user to see what you're passing to the servlet/JSP, and cases where you are doing a lot of work and don't want 9700 similar-but-not-identical pages listed on your browser's history. "POST" streams are allowed to be indefinitely long, where as "GET"s are limited to a buffer size - the infamous "code red" worm took advantage of this fact by issuing a GET request so long that it slopped out of the server's buffer and into an area where it could become executable code. A lot of times during debugging, I flip from POST to GET just to be able to see and play with the page request. since I have doGet() forwarding to doPost().
Customer surveys are for companies who didn't pay proper attention to begin with.