KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > html > FormTei


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.view.jsp.html;
8
9
10 import javax.servlet.jsp.tagext.TagData JavaDoc;
11 import javax.servlet.jsp.tagext.TagExtraInfo JavaDoc;
12
13
14 /**
15  * Validates that the forms method attribute is either post
16  * or get (case-insensitive)
17  *
18  * @author Brian Pontarelli
19  */

20 public class FormTei extends TagExtraInfo JavaDoc {
21
22     /**
23      * Returns true if the method is either post or get or empty.
24      *
25      * @return A boolean if the method attribute is valid
26      */

27     public boolean isValid(TagData JavaDoc data) {
28         String JavaDoc method = data.getAttributeString("method");
29         return (method == null || method.equalsIgnoreCase("post") ||
30             method.equalsIgnoreCase("get"));
31     }
32 }
33
Popular Tags