2013年7月31日星期三

doget (), doput () method using

 

1.doGet and doPost difference, at what time to call, why sometimes apply a doPost doGet
2. submission form method = Post on the implementation DOPOST, or perform GOGET is applied Regardless of method is post or get method is executed dopost
3.get: You can pass parameters through the URL. http://www.csdn.net/index.asp?user=1234, Post No
4. has your form submission method, if you submit to get to call the get method is invoked by post post method. get past you pass a parameter display, post is not displayed.
5. usual way: first with doGet (), and then in the doPost () call doGet (), so foolproof, of course, you can turn call.
6. Simply put, get through the http header to transmit data, quantitative restrictions, and post is through http body to transmit data, There is no limit.
7. Another point: get and post the amount of data submitted is not the same. get a maximum of 255 characters in the url followed by post do not have this restriction
8. url refresh get there seems to be no repeat of the data submitted by the original submission, and post content has been submitted will say, want to refresh please try again .

 

article comes from CSDN blog, reproduced, please indicate the source: http://blog.csdn.net/Bronze83/archive/2008/07/11/2637911.aspx

 

 

1, under what circumstances call doGet () and doPost ()?
2, servlet's init () method and the service () method of difference
3, servlet lifecycle
4, how realistic servlet single threaded mode
5, servlet's Configuring
6, four session tracking technology

 

1. what circumstances call doGet () and doPost ()?
first: If your servlet is inherited from HttpServlet, you must rewrite it inside the two virtual methods doGet and doPost, ie, the first servlet or jsp else will matter which method to call, the two methods should have.

Second: As for which method to call it, to see submission


method attribute is get, it corresponds to invoke the servlet doGet method.
Similarly, method attribute is get, it corresponds to the servlet's doPost method call.
general, regardless of the kind of submission, in the servlet to do the same. So many of our cases, a method which calls another method, such as you submitted that way, you can turn to do a treatment.

 

in a method which calls another method "is only one way to go inside to call another, such as doGet call doPost (or vice versa) can not call each other, or to form an endless loop.
2, service ( ) method is invoked automatically by the server, while the init () method is called by service () method to help call initialization work.
3, servlet's lifecycle produced only one object, the first request of it is initialized (only once), initialization after the first call to init (only once), each request, call again service--service--doGet/doPost, and then call the destroy method unloaded, end of life

 

没有评论:

发表评论