View Javadoc

1   /*
2    * $Id: TokenTag.java 130 2004-11-28 13:00:44Z josem $
3    *
4    * Tarsis
5    * Copyright (C) 2002 Talika Open Source Group
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, write to the Free Software
19   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20   *
21   */
22  
23  package org.talika.tarsis.taglib.form;
24  
25  import javax.servlet.jsp.JspException;
26  
27  import org.talika.tarsis.Globals;
28  
29  /**
30   * Implementation of token tag.
31   *
32   * @author  Jose M. Palomar
33   * @version $Revision: 130 $
34   */
35  public final class TokenTag extends InputTag {
36  
37      // Fields
38  
39      // Constructors
40      /**
41       * Creates a new <code>TokenTag</code> object.
42       */
43      public TokenTag() {
44          super("hidden");
45      }
46  
47      // Methods
48      /**
49       * Process the start tag for this instance.
50       *
51       * @return int SKIP_BODY.
52       * @throws JspException if somethign goes wrong during processing.
53       * @see javax.servlet.jsp.tagext.Tag#doStartTag()
54       */
55      public int doStartTag() throws JspException {
56  
57          setName(Globals.SYNC_TOKEN_PARAMETER);
58          setValue((String) pageContext.getSession().getAttribute(Globals.SYNC_TOKEN_PARAMETER));
59  
60          return super.doStartTag();
61  
62      }
63  
64  }