Examples of JSP response objects, jspresponse instances
Examples of JSP response objects
A response object
The response object contains information about the response to the customer request, but it is rarely used directly in JSP. It is an instance of the HttpServletResponse class. The response object has a page scope, that is, when accessing a page, the response object in the page can only be valid for this access, and the response object of other pages is invalid for the current page.
Common Methods for response objects
Three practices
<% @ Page language = "java" import = "java. util. *, java. io. * "contentType =" text/html; charset = UTF-8 "%> <% response. setContentType ("text/html; charset = UTF-8"); // set the MIMI type out of the response. println ("
Iv. Running results
Summary
The browser output of the PrintWrite object is always prior to the output of the out object.
If you have any questions, please leave a message or go to the community on this site for discussion. Thank you for reading this article. Thank you for your support!