📄 httpsession.html
字号:
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - a string specifying the name of the object
<DT><B>Returns:</B><DD>the object with the specified name
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="getAttributeNames()"><!-- --></A><H3>
getAttributeNames</H3>
<PRE>
public java.util.Enumeration <B>getAttributeNames</B>()</PRE>
<DL>
<DD>Returns an <code>Enumeration</code> of <code>String</code> objects
containing the names of all the objects bound to this session.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>an <code>Enumeration</code> of
<code>String</code> objects specifying the
names of all the objects bound to
this session
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="getValueNames()"><!-- --></A><H3>
getValueNames</H3>
<PRE>
public java.lang.String[] <B>getValueNames</B>()</PRE>
<DL>
<DD><B>Deprecated.</B> <I>As of Version 2.2, this method is
replaced by <A HREF="../../../javax/servlet/http/HttpSession.html#getAttributeNames()"><CODE>getAttributeNames()</CODE></A></I>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>an array of <code>String</code>
objects specifying the
names of all the objects bound to
this session
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="setAttribute(java.lang.String, java.lang.Object)"><!-- --></A><H3>
setAttribute</H3>
<PRE>
public void <B>setAttribute</B>(java.lang.String name,
java.lang.Object value)</PRE>
<DL>
<DD>Binds an object to this session, using the name specified.
If an object of the same name is already bound to the session,
the object is replaced.
<p>After this method executes, and if the new object
implements <code>HttpSessionBindingListener</code>,
the container calls
<code>HttpSessionBindingListener.valueBound</code>. The container then
notifies any <code>HttpSessionAttributeListener</code>s in the web
application.
<p>If an object was already bound to this session of this name
that implements <code>HttpSessionBindingListener</code>, its
<code>HttpSessionBindingListener.valueUnbound</code> method is called.
<p>If the value passed in is null, this has the same effect as calling
<code>removeAttribute()<code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to which the object is bound;
cannot be null<DD><CODE>value</CODE> - the object to be bound
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="putValue(java.lang.String, java.lang.Object)"><!-- --></A><H3>
putValue</H3>
<PRE>
public void <B>putValue</B>(java.lang.String name,
java.lang.Object value)</PRE>
<DL>
<DD><B>Deprecated.</B> <I>As of Version 2.2, this method is
replaced by <A HREF="../../../javax/servlet/http/HttpSession.html#setAttribute(java.lang.String, java.lang.Object)"><CODE>setAttribute(java.lang.String, java.lang.Object)</CODE></A></I>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to which the object is bound;
cannot be null<DD><CODE>value</CODE> - the object to be bound; cannot be null
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="removeAttribute(java.lang.String)"><!-- --></A><H3>
removeAttribute</H3>
<PRE>
public void <B>removeAttribute</B>(java.lang.String name)</PRE>
<DL>
<DD>Removes the object bound with the specified name from
this session. If the session does not have an object
bound with the specified name, this method does nothing.
<p>After this method executes, and if the object
implements <code>HttpSessionBindingListener</code>,
the container calls
<code>HttpSessionBindingListener.valueUnbound</code>. The container
then notifies any <code>HttpSessionAttributeListener</code>s in the web
application.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object to
remove from this session
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="removeValue(java.lang.String)"><!-- --></A><H3>
removeValue</H3>
<PRE>
public void <B>removeValue</B>(java.lang.String name)</PRE>
<DL>
<DD><B>Deprecated.</B> <I>As of Version 2.2, this method is
replaced by <A HREF="../../../javax/servlet/http/HttpSession.html#removeAttribute(java.lang.String)"><CODE>removeAttribute(java.lang.String)</CODE></A></I>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object to
remove from this session
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="invalidate()"><!-- --></A><H3>
invalidate</H3>
<PRE>
public void <B>invalidate</B>()</PRE>
<DL>
<DD>Invalidates this session then unbinds any objects bound
to it.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
already invalidated session</DL>
</DD>
</DL>
<HR>
<A NAME="isNew()"><!-- --></A><H3>
isNew</H3>
<PRE>
public boolean <B>isNew</B>()</PRE>
<DL>
<DD>Returns <code>true</code> if the client does not yet know about the
session or if the client chooses not to join the session. For
example, if the server used only cookie-based sessions, and
the client had disabled the use of cookies, then a session would
be new on each request.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the
server has created a session,
but the client has not yet joined
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called on an
already invalidated session</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<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="class-use/HttpSession.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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">
<A HREF="../../../javax/servlet/http/HttpServletResponse.html" title="interface in javax.servlet.http"><B>PREV CLASS</B></A>
<A HREF="../../../javax/servlet/http/HttpSessionActivationListener.html" title="interface in javax.servlet.http"><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="HttpSession.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -