The data transmitted by the request. getParameter () method is transmitted from the Web client to the Web server, representing the HTTP request data. The request. getParameter () method returns String-type data.
<% @ Page import = "java. util. *" %>
<%
String title = "HttpServletRequest Method Values ";
Map entries = new TreeMap ();
Entries. put ("getCharacterEncoding", request. getCharacterEncoding ());
Entries. put ("getContentLength", "" + request. getContentLength ());
Entries. put ("getContentType", request. getContentType ());
Entries. put ("getLocale", request. getLocale ());
Entries. put ("getProtocol", request. getProtocol ());
Entries. put ("getRemoteAddr", request. getRemoteAddr ());
Entries. put ("getRemoteHost", request. getRemoteHost ());
Entries. put ("getScheme", request. getScheme ());
Entries. put ("getServerName", request. getServerName ());
Entries. put ("getServerPort", "" + request. getServerPort ());
Entries. put ("isSecure", "" + request. isSecure ());
Request. setAttribute ("_ table_title", title );
Request. setAttribute ("_ table_entries", entries );
Out. println (request. getCharacterEncoding ());
%>
Request. getParameter () is achieved through the implementation of the container to obtain data transmitted through methods such as post and get.
<H1> Request Information </H1>
JSP request method: <% = request. getMethod () %>
<BR>
URL for the request: <% = request. getRequestURI () %>
<BR>
Protocol of the request: <% = request. getProtocol () %>
<BR>
Server name: <% = request. getServerName () %>
<BR>
Path: <% = request. getServletPath () %>
<BR>
Server port: <% = request. getServerPort () %>
<BR>
Remote address: <% = request. getRemoteAddr () %>
<BR>
Remote host: <% = request. getRemoteHost () %>
<BR>
Locale: <% = request. getLocale () %>
<BR>
User agent: <% = request. getHeader ("User-Agent") %>
From get data
<Html>
<Head>
<Title> Retrieving the Original URI </title>
</Head>
<Body>
<Pre>
In ShowPath1.jsp tutorial:
Request. getRequestURI () =
<% = Request. getRequestURI () %>
Request. getServletPath () =
<% = Request. getServletPath () %>
</Pre>
<Jsp: include page = "ShowPath2.jsp" flush = "true"/>
</Body>
</Html>