JSP built-in Object "03" finished school the request object, now learning Response object, request is client to server-side requests, and response is server-side response to the client.
Introduction to Response objects
The main purpose of the response object is to respond to requests from the client and send the results of the Web server processing back to the client.
The response object belongs to an instance of the Javax.servlet.http.HttpServletResponse interface
The definition format of the HttpServletResponse interface is very similar to the definition format of the HttpServletRequest interface, with only one parent interface, and only one sub-interface
Let's take a look at the specific applications of these methods:
Set Header information: page refresh, auto jump function
All the information is automatically sent to the server or client with the request and response, and the response header information is automatically refreshed.
response_01.jsp automatic refresh feature
<%@ page language= "java" contenttype= "text/html" pageencoding= "Utf-8"%>
< html>
Run it to find that the page is refreshed every 2 seconds. In addition to the scheduled refresh, there are timed jumps, the code is as follows:
response_02.jsp Automatic Jump
<%@ page language= "java" contenttype= "text/html" pageencoding= "Utf-8"%>