You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by gl...@locus.apache.org on 2000/10/30 00:01:37 UTC

cvs commit: jakarta-taglibs/session/src/org/apache/taglibs/session SessionTag.java

glenn       00/10/29 15:01:37

  Modified:    session/src/org/apache/taglibs/session SessionTag.java
  Log:
  Cleanup for release
  
  Revision  Changes    Path
  1.2       +15 -66    jakarta-taglibs/session/src/org/apache/taglibs/session/SessionTag.java
  
  Index: SessionTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/session/src/org/apache/taglibs/session/SessionTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SessionTag.java	2000/09/24 03:25:38	1.1
  +++ SessionTag.java	2000/10/29 23:01:36	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-taglibs/session/src/org/apache/taglibs/session/SessionTag.java,v 1.1 2000/09/24 03:25:38 glenn Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/09/24 03:25:38 $
  + * $Header: /home/cvs/jakarta-taglibs/session/src/org/apache/taglibs/session/SessionTag.java,v 1.2 2000/10/29 23:01:36 glenn Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/10/29 23:01:36 $
    *
    * ====================================================================
    *
  @@ -71,7 +71,7 @@
    * the standard JSP <jsp:getProperty> tag.
    * <p>
    * The script variable of name <b>id</b> is available for use during
  - * processing of the entire JSP page.
  + * processing of the remainder of the JSP page.
    * <p>
    * JSP Tag Lib Descriptor
    * <p><pre>
  @@ -79,84 +79,33 @@
    * &lt;tagclass&gt;org.apache.taglibs.session.SessionTag&lt;/tagclass&gt;
    * &lt;teiclass&gt;org.apache.taglibs.session.SessionTEI&lt;/teiclass&gt;
    * &lt;bodycontent&gt;empty&lt;/bodycontent&gt;
  - * &lt;info&gt;Used to get information about the current session.&lt;/info&gt;
  + * &lt;info&gt;Used to access general information about session.&lt;/info&gt;
    *   &lt;attribute&gt;
    *     &lt;name&gt;id&lt;/name&gt;
  - *     &lt;sessuired&gt;true&lt;/sessuired&gt;
  + *     &lt;required&gt;true&lt;/required&gt;
    *     &lt;rtexprvalue&gt;false&lt;/rtexprvalue&gt;
    *   &lt;/attribute&gt;
    * </pre>
    *
  + * @see SessionData
  + * @see SessionTEI
  + *
    * @author Glenn Nielsen
    */
   
   public class SessionTag extends TagSupport
   {
  -    private HttpSession sess;
  -
       /**
  -     * Method called at start of tag, gets HttpSession.
  +     * Method called at start of tag, gets HttpSession and creates a
  +     * script variable of name id.
        *
        * @return SKIP_BODY
        */
  -    public int doStartTag() throws JspException
  +    public final int doStartTag() throws JspException
       {
  -	sess = (HttpSession)pageContext.getSession();
  -	pageContext.setAttribute(id,this,PageContext.REQUEST_SCOPE);
  +	pageContext.setAttribute(id,
  +	    new SessionData(pageContext.getSession()),
  +	    PageContext.PAGE_SCOPE);
   	return SKIP_BODY;
       }
  -
  -    /**
  -     * Returns the time when this session was created, measured in
  -     * milliseconds since midnight January 1, 1970 GMT as a String.
  -     * <p>
  -     * &lt;jsp:getProperty name=<i>"id"</i> property="creationTime"/&gt;
  -     *
  -     * @return creation of session in ms as a String
  -     */
  -    public final String getCreationTime()
  -    {
  -	return "" + sess.getCreationTime();
  -    }
  -
  -    /**
  -     * Returns a string containing the unique identifier assigned to this
  -     * session.
  -     * <p>
  -     * &lt;jsp:getProperty name=<i>"id"</i> property="sessionId"/&gt;
  -     *
  -     * @return session id
  -     */
  -    public final String getSessionId()
  -    {
  -	return sess.getId();
  -    }
  -
  -    /**
  -     * Returns the last time the client sent a request associated with
  -     * this session, as the number of milliseconds since midnight
  -     * January 1, 1970 GMT as a String.
  -     * <p>
  -     * &lt;jsp:getProperty name=<i>"id"</i> property="lastAccessedTime"/&gt;
  -     *
  -     * @return last time session was accessed as a String
  -     */
  -    public final String getLastAccessedTime()
  -    {
  -	return "" + sess.getLastAccessedTime();
  -    }
  -
  -    /**
  -     * Returns the maximum time interval, in seconds, that the servlet
  -     * container will keep this session open between client accesses.
  -     * <p>
  -     * &lt;jsp:getProperty name=<i>"id"</i> property="maxInactiveInterval"/&gt;
  -     *
  -     * @return the maximum inactive interval in seconds as a String
  -     */
  -    public final String getMaxInactiveInterval()
  -    {
  -	return "" + sess.getMaxInactiveInterval();
  -    }
  -
   }