First, several important concepts in Java Web development
1.HTTP Request: After the client connects to the server, it requests a Web resource from the server, which is called the client sends an HTTP request to the server. A complete HTTP request includes a request header, several message headers, and the entity content.
2.Servlet: The servlet is a technology that Sun offers to develop dynamic Web resources. Sun provides a servlet interface in its API that users want to develop a dynamic web resource (that is, developing a Java program to output data to a browser), which requires two steps: 1. Write a Java class to implement the Servlet interface; 2. Deploy the well-developed Java class to the server. In accordance with the Convention idiomatic, usually we also implement the Servlet interface Java program, called the servlet.
The 3.HttpServletResponse and Httpservletrequest:web servers receive HTTP requests from the client, creating a Request object for each request and a response object to respond to the request, respectively. Then we need to get the data submitted by the client, just find the request object on the line. To output data to the client, just look for the response object.
4. Session: The session can be simply understood as: The customer opens a browser, click multiple hyperlinks, access the server multiple Web resources, and then close the browser, this whole process is called a session. The two techniques for saving session data are cookie and Session,cookie are client technologies: The program writes each user's data to the user's respective browser in the form of a cookie. When users use the browser to access these Web resources, they will take their own data, so that the Web resources processing is the user's own data, the session is server-side technology.
The 5.jsp:jsp full name is Java Server pages, which, like servlet technology, is a technology defined by sun to develop dynamic Web resources. The biggest feature of JSP technology is that writing JSP is like writing HTML, but compared with HTML, HTML only provides static data for the user, while JSP technology allows embedding Java code to provide dynamic data to the user. JSP principle: The browser sends a request to the server, regardless of what resources are accessed, is actually accessing the servlet, so when accessing a JSP page, is actually accessing a servlet, when the server executes the JSP, first translates the JSP into a servlet, So when we visit the JSP, we are not actually accessing the JSP, but we are accessing the servlet after the translation.
6.javabean:javabean is a Java class that follows a specific notation. Usually there are the following features: 1 This Java class must have a parameterless constructor 2 property must be privatized 3 properties that are privatized must be exposed to other programs by means of the public type, and the name of the method must follow a certain naming convention.
Java Web Learning Summary