httpservletrequest.html
来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 1,051 行 · 第 1/3 页
HTML
1,051 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:38 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Interface HttpServletRequest
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../javax/servlet/http/HttpServletResponse.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="HttpServletRequest.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.servlet.http</FONT>
<BR>
Interface HttpServletRequest</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/servlet/ServletRequest.html">ServletRequest</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/servlet/http/HttpServletRequestWrapper.html">HttpServletRequestWrapper</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>HttpServletRequest</B><DT>extends <A HREF="../../../javax/servlet/ServletRequest.html">ServletRequest</A></DL>
<P>
Extends the <A HREF="../../../javax/servlet/ServletRequest.html"><CODE>ServletRequest</CODE></A> interface
to provide request information for HTTP servlets.
<p>The servlet container creates an <code>HttpServletRequest</code>
object and passes it as an argument to the servlet's service
methods (<code>doGet</code>, <code>doPost</code>, etc).
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#BASIC_AUTH">BASIC_AUTH</A></B></CODE>
<BR>
String identifier for Basic authentication.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#CLIENT_CERT_AUTH">CLIENT_CERT_AUTH</A></B></CODE>
<BR>
String identifier for Basic authentication.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#DIGEST_AUTH">DIGEST_AUTH</A></B></CODE>
<BR>
String identifier for Basic authentication.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#FORM_AUTH">FORM_AUTH</A></B></CODE>
<BR>
String identifier for Basic authentication.</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getAuthType()">getAuthType</A></B>()</CODE>
<BR>
Returns the name of the authentication scheme used to protect
the servlet.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getContextPath()">getContextPath</A></B>()</CODE>
<BR>
Returns the portion of the request URI that indicates the context
of the request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/servlet/http/Cookie.html">Cookie</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getCookies()">getCookies</A></B>()</CODE>
<BR>
Returns an array containing all of the <code>Cookie</code>
objects the client sent with this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getDateHeader(java.lang.String)">getDateHeader</A></B>(java.lang.String name)</CODE>
<BR>
Returns the value of the specified request header
as a <code>long</code> value that represents a
<code>Date</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getHeader(java.lang.String)">getHeader</A></B>(java.lang.String name)</CODE>
<BR>
Returns the value of the specified request header
as a <code>String</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Enumeration</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getHeaderNames()">getHeaderNames</A></B>()</CODE>
<BR>
Returns an enumeration of all the header names
this request contains.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Enumeration</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getHeaders(java.lang.String)">getHeaders</A></B>(java.lang.String name)</CODE>
<BR>
Returns all the values of the specified request header
as an <code>Enumeration</code> of <code>String</code> objects.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getIntHeader(java.lang.String)">getIntHeader</A></B>(java.lang.String name)</CODE>
<BR>
Returns the value of the specified request header
as an <code>int</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getMethod()">getMethod</A></B>()</CODE>
<BR>
Returns the name of the HTTP method with which this
request was made, for example, GET, POST, or PUT.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getPathInfo()">getPathInfo</A></B>()</CODE>
<BR>
Returns any extra path information associated with
the URL the client sent when it made this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getPathTranslated()">getPathTranslated</A></B>()</CODE>
<BR>
Returns any extra path information after the servlet name
but before the query string, and translates it to a real
path.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getQueryString()">getQueryString</A></B>()</CODE>
<BR>
Returns the query string that is contained in the request
URL after the path.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getRemoteUser()">getRemoteUser</A></B>()</CODE>
<BR>
Returns the login of the user making this request, if the
user has been authenticated, or <code>null</code> if the user
has not been authenticated.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getRequestedSessionId()">getRequestedSessionId</A></B>()</CODE>
<BR>
Returns the session ID specified by the client.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getRequestURI()">getRequestURI</A></B>()</CODE>
<BR>
Returns the part of this request's URL from the protocol
name up to the query string in the first line of the HTTP request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.StringBuffer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getRequestURL()">getRequestURL</A></B>()</CODE>
<BR>
Reconstructs the URL the client used to make the request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getServletPath()">getServletPath</A></B>()</CODE>
<BR>
Returns the part of this request's URL that calls
the servlet.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/servlet/http/HttpSession.html">HttpSession</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getSession()">getSession</A></B>()</CODE>
<BR>
Returns the current session associated with this request,
or if the request does not have a session, creates one.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/servlet/http/HttpSession.html">HttpSession</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getSession(boolean)">getSession</A></B>(boolean create)</CODE>
<BR>
Returns the current <code>HttpSession</code>
associated with this request or, if if there is no
current session and <code>create</code> is true, returns
a new session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.security.Principal</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#getUserPrincipal()">getUserPrincipal</A></B>()</CODE>
<BR>
Returns a <code>java.security.Principal</code> object containing
the name of the current authenticated user.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdFromCookie()">isRequestedSessionIdFromCookie</A></B>()</CODE>
<BR>
Checks whether the requested session ID came in as a cookie.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdFromUrl()">isRequestedSessionIdFromUrl</A></B>()</CODE>
<BR>
<B>Deprecated.</B> <I>As of Version 2.1 of the Java Servlet
API, use <A HREF="../../../javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdFromURL()"><CODE>isRequestedSessionIdFromURL()</CODE></A>
instead.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdFromURL()">isRequestedSessionIdFromURL</A></B>()</CODE>
<BR>
Checks whether the requested session ID came in as part of the
request URL.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdValid()">isRequestedSessionIdValid</A></B>()</CODE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?