1. JSP client Request
When a browser requests a Web page, it sends a series of information to the Web server that cannot be read directly, because the information is transmitted as part of the HTTP header, as shown in:
The HTTP request header corresponds to the following:
The corresponding method is as follows:
2.JSP Server Response:
The response response object mainly passes the result of the JSP container processing back to the client. You can set the state of HTTP through the response variable and send data to the client, such as cookies, HTTP file header information, and so on, as shown in:
The HTTP response header corresponds to the following:
The corresponding method is as follows:
3.JSP Cookie Processing methods:
Cookies are text files that are stored in the client computer, and they hold a large amount of trace information. On the basis of servlet technology, JSP can provide support for HTTP cookies.
There are usually three steps to identify repeat customers:
- The server script sends a series of cookies to the browser. such as name, age, ID number and so on.
- The browser stores this information in a local machine for a rainy-out.
- The next time the browser sends any request to the server, it will send the cookie information to the server at the same time, and the server uses that information to identify the user or do something else.
Common methods are as follows:
4.JSP Session object:
In addition to the above methods, JSP uses the HttpSession interface provided by the servlet to identify a user and store all of the user's access information. By default, the JSP allows session tracing, and a new HttpSession object is automatically instantiated for the new client, as follows:
5. JSP JavaBean method:
JSP objects and JavaBean