com.acsinet_solutions.cetia4.tags
Class FormTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.acsinet_solutions.cetia4.tags.support.LogBodyTagSupport
              extended by com.acsinet_solutions.cetia4.tags.support.AbstractLinkTag
                  extended by com.acsinet_solutions.cetia4.tags.FormTag
All Implemented Interfaces:
AttributeKeys, ControllerConstants, ParameterAppender, java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
Direct Known Subclasses:
ButtonTag

public class FormTag
extends AbstractLinkTag

Implementation of a simple form tag that allows easy navigation and mapping.

Author:
Santiago Arriaga
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface com.acsinet_solutions.cetia4.controller.ControllerConstants
_METHOD_PARAM, _PAGE_PARAM, _ROOT_PARAM, DEFAULT_VIEW, ERROR_URL, ERROR_VIEW, LOAD_CANCEL, LOAD_CURRENT, LOAD_DEFAULT, LOAD_ERROR, LOAD_PREVIOUS
 
Fields inherited from interface com.acsinet_solutions.cetia4.controller.AttributeKeys
_BUNDLE_KEY, _CONFIGURATION_KEY, _DEFAULT_CONTROLLER_KEY, _FORM_ACTION_KEY, _FORM_ATTRIBUTE_KEY, _LOCALE_KEY, _MESSAGE_KEY, _NAVIGATION_FLOW_KEY, _PORTAL_PATH_KEY, _RENDER_PARAMETERS_KEY, _SERVICE_LOCATOR_KEY, _SESSION_KEY, _SYSTEM_EXCEPTION_KEY, _VALIDATION_EXCEPTION_KEY
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
FormTag()
          Default constructor, creates a post form.
FormTag(java.lang.String defaultMethod, boolean fillDynamicValues)
          Parametric constructor
 
Method Summary
 int doEndTag()
           
 int doStartTag()
           
 java.lang.Object getProperty(java.lang.String property)
          Get the given property for the configured bean.
 boolean hasBeanInfo(java.lang.String property)
          Check if the wrapped bean has a given property.
 void setBean(java.lang.Object bean)
          Sets the not null bean over which the tag will operate.
 void setMethod(java.lang.String method)
          Sets the HTTP method of the form.
protected  void writeBody(javax.servlet.jsp.JspWriter writer, java.lang.String body)
          Write the body to the JSP output
protected  void writeFormEnd(javax.servlet.jsp.JspWriter writer)
          Write the form start tag.
protected  void writeFormStart(javax.servlet.jsp.JspWriter writer, URLLink link)
          Write the form start tag
 
Methods inherited from class com.acsinet_solutions.cetia4.tags.support.AbstractLinkTag
addParameter, getLink, isActionProvided, removeParameter, setAction, setLink, setSection, writeBody
 
Methods inherited from class com.acsinet_solutions.cetia4.tags.support.LogBodyTagSupport
doCatch, doFinally, fillDynamicValues, fillDynamicValues, getConfiguration, getDynamicAttributes, getLocale, getLogger, getPortalPath, getRequest, getServletContext, getSession, setDynamicAttribute
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
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
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

FormTag

public FormTag()
Default constructor, creates a post form.


FormTag

public FormTag(java.lang.String defaultMethod,
               boolean fillDynamicValues)
Parametric constructor

Method Detail

setMethod

public final void setMethod(java.lang.String method)
Sets the HTTP method of the form. This field also accept the invoked method name for POST methods. So a method named "insert" means a POST form with a hidden field named "method" with value "insert"

See Also:
ControllerConstants._METHOD_PARAM

setBean

public final void setBean(java.lang.Object bean)
                   throws javax.servlet.jsp.JspException
Sets the not null bean over which the tag will operate. This bean will hold the properties for the default values of input tags, select ( combo ) tags and text area tags.

Throws:
javax.servlet.jsp.JspException
See Also:
hasBeanInfo(String)

hasBeanInfo

public final boolean hasBeanInfo(java.lang.String property)
Check if the wrapped bean has a given property. This may be used by inner tags to obtain default values. Nested properties are supported.

What this means is that if the _bean instance has a property named getText(), the hasBeanInfo( "text" ) call will return true. On a nested cetia:textField tag whose name attribute is "text" and no value attribute, that will result in setting the tag's default value as the value returned by the bean's getText() method.

If the bean has a nested property getParent().getText(), then the hasBeanInfo( "parent.text" ) will return true, and the value of a tag with no value attribute but whose name is "parent.text" will be set using this nested property.

See Also:
ReflectionUtils.hasReadProperty(Object,String), TextFieldTag.setValue(Object), TextAreaTag.setValue(String), ComboTag.setSelected(Object)

getProperty

public final java.lang.Object getProperty(java.lang.String property)
Get the given property for the configured bean. This method should only be called if hasBeanInfo() returned true for this same property.

See Also:
hasBeanInfo(String), ReflectionUtils.getProperty(Object,String)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class AbstractLinkTag
Throws:
javax.servlet.jsp.JspException
See Also:
BodyTagSupport

writeBody

protected void writeBody(javax.servlet.jsp.JspWriter writer,
                         java.lang.String body)
                  throws javax.servlet.jsp.JspException,
                         java.io.IOException
Description copied from class: AbstractLinkTag
Write the body to the JSP output

Specified by:
writeBody in class AbstractLinkTag
Throws:
javax.servlet.jsp.JspException
java.io.IOException

writeFormStart

protected void writeFormStart(javax.servlet.jsp.JspWriter writer,
                              URLLink link)
                       throws java.io.IOException
Write the form start tag

Throws:
java.io.IOException

writeFormEnd

protected final void writeFormEnd(javax.servlet.jsp.JspWriter writer)
                           throws java.io.IOException
Write the form start tag. This may be too little to put in its own method but it's done like this just to be organized.

Throws:
java.io.IOException