Detailed description of JSP request object instances and jsprequest
Detailed description of JSP request object instances
1. request object definition
The request information of the client is encapsulated in the request object to understand the customer's requirements and then respond. It is an instance of the HttpServletRequest class. The request object has a request domain, that is, the object remains valid until the client completes the request.
2. request object Method
Three instances
<% @ Page language = "java" import = "java. util. * "contentType =" text/html; charset = UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %> <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
4. Running Effect
Five knowledge points
1. Solve the Problem of garbled Chinese parameters passing through URLs
Modify server in D: \ apache-tomcat-7.0.81 \ conf. xml <Connector port = "8888" protocol = "HTTP/1.1" connectionTimeout = "20000" redirectPort = "8443" URIEncoding = "UTF-8"/>
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!