In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the knowledge points of HttpServlet in the Servlet program?" interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the knowledge points of HttpServlet in the Servlet program?"
HttpServlet is a subclass of GenericServlet
HttpServlet is a subclass of GennericServlet and is only used to receive Http requests and responses.
In general, the Servlet you need to use in web development only needs to implement this class.
HttpServlet classes using HTTP communication protocol are defined in the servlet.http package
The request methods of HTTP include DELETE,GET,OPTIONS,POST,PUT and TRACE
The corresponding service methods are provided in the HttpServlet class, and they are
DoDelete (), doGet (), doOptions (), doPost (), doPut () and doTrace ().
The process for the HttpServlet container to respond to Web customer requests is as follows:
1) Web customer issues Http request to Servlet container
2) Servlet container parses Web customer's Http request
3) the Servlet container creates a HttpRequest object that encapsulates Http request information
4) Servlet container creates a HttpResponse object
5) Servlet container calls the service method of HttpServlet
Pass the HttpRequest and HttpResponse objects to the HttpServlet object as parameters of the service method
6) HttpServlet calls the relevant methods of HttpRequest to obtain HTTP request information
7) HttpServlet calls the relevant methods of HttpResponse to generate response data
8) the Servlet container passes the response result of the HttpServlet to the Web customer.
Knowledge points of Service ()
Servlet created in both myeclipse and idea inherits Service () by default, but is not displayed
You just need to rewrite the get,post in Servlet as doGet () and doPost ().
Make a form
In HTML
There are methed=get and methed=post.
Setting get will display information in the access address, which is equivalent to transmitting the database in the form of information.
Setting post hides the information and displays it as an address, but the data can also be transmitted.
At this point, I believe you have a deeper understanding of "what are the knowledge points of HttpServlet in the Servlet program?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.