Where is javax servlet session




















Skip navigation links. Uses of Interface javax. Packages that use HttpSession Package Description javax. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time. An interval value of zero or less indicates that the session should never timeout.

Parameters: interval - An integer specifying the number of seconds getMaxInactiveInterval int getMaxInactiveInterval Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.

After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A return value of zero or less indicates that the session will never timeout. Parameters: name - a string specifying the name of the object Returns: the object with the specified name Throws: IllegalStateException - if this method is called on an invalidated session getValue Object getValue String name Deprecated. Returns: an Enumeration of String objects specifying the names of all the objects bound to this session Throws: IllegalStateException - if this method is called on an invalidated session getValueNames String [] getValueNames Deprecated.

If an object of the same name is already bound to the session, the object is replaced. The container then notifies any HttpSessionAttributeListener s in the web application. If the value passed in is null, this has the same effect as calling removeAttribute. Parameters: name - the name to which the object is bound; cannot be null value - the object to be bound Throws: IllegalStateException - if this method is called on an invalidated session putValue void putValue String name, Object value Deprecated.

Object Parameters: name - the name to which the object is bound; cannot be null value - the object to be bound; cannot be null Throws: IllegalStateException - if this method is called on an invalidated session removeAttribute void removeAttribute String name Removes the object bound with the specified name from this session.

Removes an item from the session. All values bound to this session with putValue that implement HttpSessionBindingListener will be called with valueUnbound. Also: make it throw an IllegalStateException when a servlet tries to execute one of its methods. Returns whether this session has been freshly created. The Servlet can use this method to check whether the HttpSession has been newly created or if a HttpSession had already been created for a previous request.

String name Deprecated. String name, java. Object value Deprecated. Improve this answer. You'll need to import javax. HttpSession but javac will complain if you don't do that anyway. Dunno if it's different because new versions, but now I've had to import javax. HttpSession , instead of javax. HttpSession , just for the sake of completeness. Sign up or log in Sign up using Google. Sign up using Facebook.

Sign up using Email and Password. Post as a guest Name.



0コメント

  • 1000 / 1000