Introduction to JSP built-in objects (4) Response objects

Source: Internet
Author: User
Tags count html page

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"%>    
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.