com.bea.web.tag
Class AbstractInputTagSupport

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.bea.web.tag.AbstractInputTagSupport
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
CheckBoxTagSupport, DateTagSupport, DoubleTagSupport, EmailTagSupport, FloatTagSupport, IdentifierTagSupport, IntegerTagSupport, PasswordTagSupport, RadioTagSupport, TextareaTagSupport, TextTagSupport, URLTagSupport

public abstract class AbstractInputTagSupport
extends javax.servlet.jsp.tagext.TagSupport
implements Serializable

An abstract base class for input tags to extend from. The tag classes provided by the Web toolkit generate the HTML for a form field and pre-populate its value with a default, if applicable. In addition, the tag classes display a localized error message next to the form field if the value supplied by the user is invalid. Moreover, instances of this class initialize a com.bea.web.validation.Word object and save it in Web application scope so that the validation object is accessible by the ControllerServlet using the form field’s name. Lastly, this class encapsulates attributes that are common to all input tags:

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
AbstractInputTagSupport()
          Default constructor, all subclasses of javax.servlet.jsp.tagext.TagSupport are required to only define a public constructor with the same signature, and to call the superclass constructor.
 
Method Summary
 String getAttrs()
           
 String getDefault()
           
 int getMaxlength()
           
 String getName()
           
 int getSize()
           
 boolean isRequired()
           
protected  void printError(javax.servlet.jsp.JspWriter out, String strError)
          Prints an error with HTML markup to the supplied output writer.
 void release()
          Resets the internal state of this instance for reuse.
 void setAttrs(String strAttrs)
          Sets any HTML Attrs for this input tag
 void setDefault(String strDefault)
          Sets the default value for this input tag
 void setMaxlength(int iLength)
          Sets the maxlength for this form field.
 void setName(String strName)
          Sets the name of this input tag
 void setRequired(boolean bIsRequired)
          Sets whether this input field is required for successful processing of the HTML form.
 void setSize(int iSize)
          Sets the size for this form field.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInputTagSupport

public AbstractInputTagSupport()
Default constructor, all subclasses of javax.servlet.jsp.tagext.TagSupport are required to only define a public constructor with the same signature, and to call the superclass constructor.

Method Detail

release

public void release()
Resets the internal state of this instance for reuse. Subclasses should call this method when they are resetting their internal state.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

printError

protected void printError(javax.servlet.jsp.JspWriter out,
                          String strError)
Prints an error with HTML markup to the supplied output writer.


getDefault

public final String getDefault()
Returns:
the default value for this input tag

getAttrs

public final String getAttrs()
Returns:
the HTML Attrs for this input tag

getMaxlength

public final int getMaxlength()
Returns:
the maximum length for this input tag

getName

public final String getName()
Returns:
the name for this input tag

getSize

public final int getSize()
Returns:
the size for this input tag

isRequired

public final boolean isRequired()
Returns:
true if the user must supply this field, false otherwise

setDefault

public final void setDefault(String strDefault)
Sets the default value for this input tag

Parameters:
strDefault - - the default value; if null or "" empty, the value is ignored

setAttrs

public final void setAttrs(String strAttrs)
Sets any HTML Attrs for this input tag

Parameters:
strAttrs - - the HTML Attrs; if null or "" empty, the value is ignored

setMaxlength

public final void setMaxlength(int iLength)
Sets the maxlength for this form field.


setName

public final void setName(String strName)
                   throws IllegalArgumentException
Sets the name of this input tag

Parameters:
strName - - the name; cannot be null or empty ""
Throws:
IllegalArgumentException - if strName is null or "" empty

setRequired

public final void setRequired(boolean bIsRequired)
Sets whether this input field is required for successful processing of the HTML form.


setSize

public final void setSize(int iSize)
Sets the size for this form field.