Previous Section  < Day Day Up >  Next Section

D.10 Package javax.faces.webapp

AttributeTag

This class is a JSP tag handler class for an action that sets a generic attribute of the component represented by the closest UIComponentTag parent tag handler.

Synopsis

Class name:

javax.faces.webapp.AttributeTag

Extends:

javax.servlet.jsp.tagext.TagSupport

Implements:

javax.servlet.jsp.tagext.IterationTag

Constructors


public AttributeTag()

Creates an instance.

Methods


public int doStartTag()

Sets a generic attribute with the name and value corresponding to this tag handler's attributes for the component represented by the closest UIComponentTag parent tag handler if this component doesn't already have an attribute with this name.


public void release()

Releases all references to acquired resources.


public void setName(String name)

Sets the attribute name.


public void setValue(String name)

Sets the attribute value.

ConverterTag

This class is a base class for JSP tag handler class actions that configures the component represented by the closest UIComponentTag parent tag handler with a Converter.

Synopsis

Class name:

javax.faces.webapp.ConverterTag

Extends:

javax.servlet.jsp.tagext.TagSupport

Implements:

javax.servlet.jsp.tagext.IterationTag

Constructors


public ConverterTag()

Creates an instance.

Methods


protected javax.faces.convert.Converter createConverter()

Returns a Converter, configured based on tag handler attribute values. An implementation of this method can be provided by a subclass. This implementation creates an instance of the converter identified by the converterId attribute.


public int doStartTag()

Calls createConverter() to create a Converter and configures the component represented by the closest UIComponentTag parent tag handler to use if the component was created while processing the JSP page.


public void release()

Releases all references to acquired resources.


public void setConverterId(String converterId)

Sets the converterId attribute.

FacesServlet

This class is a servlet that acts as the entry point to a JSF view. It creates all infrastructure instances and then asks them to process the request as a JSF request.

Synopsis

Class name:

javax.faces.webapp.FacesServlet

Extends:

None

Implements:

javax.servlet.Servlet

Fields


public static final String CONFIG_FILES_ATTR

The name of the application context initialization parameter holding a list of JSF configuration files: javax.faces.CONFIG_FILES.


public static final String LIFECYCLE_ID_ATTR

The name of the application context initialization parameter holding the class name of the Lifecycle implementation to use: javax.faces.LIFECYCLE_ID.

Constructors


public FacesServlet()

Creates an instance.

Methods


public void destroy()

Releases all acquired resources.


public javax.servlet.ServletConfig getServletConfig()

Returns the ServletConfig instance.


public String getServletInfo()

Returns information about this servlet.


public void init(javax.servlet.ServletConfig config)

Acquire all JSF infrastructure instances needed to process JSF requests.


public void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws java.io.IOException, javax.servlet.ServletException

Create a Lifecycle instance and ask it to process the request.

FacetTag

This class is a JSP tag handler class for an action that configures the component represented by the closest UIComponentTag parent tag handler with the facet component represented by its single child UIComponentTag tag handler.

Synopsis

Class name:

javax.faces.webapp.FacetTag

Extends:

javax.servlet.jsp.tagext.TagSupport

Implements:

javax.servlet.jsp.tagext.IterationTag

Constructors


public FacetTag()

Creates an instance.

Methods


public int doEndTag()

Returns EVAL_PAGE.


public int doStartTag()

Returns EVAL_BODY_INCLUDE.


public void release()

Releases all references to acquired resources.


public void setName(String name)

Sets the facet name.

UIComponentBodyTag

This class is a JSP tag handler base class that all JSF actions that represent a UIComponent instance that need access to the element body evaluation result extend.

Synopsis

Class name:

javax.faces.webapp.UIComponentBodyTag

Extends:

javax.faces.webapp.UIComponentTag

Implements:

javax.servlet.jsp.tagext.BodyTag

Fields


protected javax.servlet.jsp.tagext.BodyContent bodyContent

The variable holding the buffered BodyContent.

Constructors


public UIComponentBodyTag()

Creates an instance.

Methods


public int doAfterBody()

Returns the value of getDoAfterBodyValue().


public int doInitBody()

This implementation does nothing. Can be overridden by subclasses to prepare for the body evaluation.


public javax.servlet.jsp.tagext.BodyContent getBodyContent()

Returns the value of the bodyContent variable.


public int getDoAfterBodyValue()

Returns the value to return from doAfterBodyValue( ), as established by a subclass. This implementation returns SKIP_BODY.


public int getDoStartValue()

Returns the value to return from doStartTag(), as established by a subclass. This implementation returns EVAL_BODY_BUFFERED.


public javax.servlet.jsp.JspWriter getPreviousOut()

Returns the JspWriter for the parent tag handler.


public void release()

Releases all references to acquired resources.


public void setBodyContent(javax.servlet.jsp.tagext.BodyContent bodyContent)

Sets the value of the bodyContent variable.

UIComponentTag

This class is a JSP tag handler base class that all JSF actions that represent a UIComponent instance that don't need access to the element body evaluation result extend.

Synopsis

Class name:

javax.faces.webapp.UIComponentBodyTag

Extends:

None

Implements:

javax.servlet.jsp.tagext.Tag

Fields


protected javax.servlet.jsp.PageContext pageContext

The variable holding the PageContext for the JSP page.

Constructors


public UIComponentTag()

Creates an instance.

Methods


public int doEndTag()

Renders the end of the component the tag handler represents. If the component's getRendersChildren() method returns true, calls encodeBegin( ) and encodeChildren(), and calls encodeEnd() independent on the getRendersChildren() value. This method also adjusts the children and facets for the component it represents, by removing children and facets created by conditional portions of the JSP page the last time it was processed but not processed this time.


public int doStartTag()

Calls setupResponseWriter(), in case this is the first tag handler in the page. Calls the findComponent( ) method to locate the component this tag handler represents, creating it if it isn't already available in the view. If a new component was created, add it as a child of the component represented by the closest UIComponentTag parent tag handler, if any, by calling the parent's addChild() method. Calls encodeBegin(), unless its getRendersChildren() method returns true.


protected void encodeBegin()

Delegates the call to the component this tag handler represents.


protected void encodeChildren()

Delegates the call to the component this tag handler represents.


protected void encodeEnd()

Delegates the call to the component this tag handler represents.


protected javax.faces.component.UIComponent findComponent(javax.faces.context.FacesContext context)

Locates or creates the component the tag handler represents. An attempt to find the component is done by locating a parent UIComponentTag tag handler and asking it for its component. If this tag handler represents a facet, try to get a facet with the same name from the parent, otherwise try to get a child based on the component ID. If the component doesn't exits, creates an instance of the type returned by getComponentType(), calls setProperties( ) and adds the new component as a facet or child of the parent.


public javax.faces.component.UIComponent getComponentInstance()

Returns the component the tag handler represents, if called between doStartTag() and doEndTag().


public String getComponentType()

Returns the component type the tag handler represents.


public boolean getCreated()

Returns true if the component instance was created by this tag handler during the processing of this request.


public int getDoEndValue()

Returns the value to return from doEndTag(), as established by a subclass. This implementation returns EVAL_PAGE.


public int getDoStartValue()

Returns the value to return from doStartTag(), as established by a subclass. This implementation returns EVAL_BODY_INCLUDE.


public javax.facet.context.FacesContext getFacetContext()

Returns the current FacetContext instance for the request.


protected String getFacetName()

Returns the name of the facet this tag handler represents or null if it represents a regular child component.


protected String getId()

Returns the id attribute value or null if not set.


public javax.servlet.jsp.tagext.Tag getParent()

Returns the parent tag handler or null if none.


public static javax.facet.webapp.UIComponentTag getParentUIComponentTag(javax.facet.context.FacesContext context)

Returns the closest parent UIComponentTag tag handler or null if none. This method uses a stack to keep track of the nesting level, even between included pages processed as part of the same request.


public String getRendererType()

Returns the renderer type or null.


protected boolean isSuppressed()

Returns true if the component is a facet, the component's rendered property is false, its parent's rendersChildren property is true, or the component's parent returns true from this method.


public static boolean isValueReference(String value)

Returns true if the value is a JSF EL expression, i.e., is delimited by #{ and }.


public void release()

Releases all references to acquired resources.


public void setBinding(String binding)

Sets a component binding expression.


public void SetId(String id)

Sets the id attribute value, to be used as the component ID for the component represented by the tag header.


public void setPageContext(javax.servlet.jsp.PageContext pageContext)

Sets the pageContext variable.


public void setParent(javax.servlet.jsp.tagext.Tag parent)

Sets the parent for this tag handler.


protected void setProperties(javax.facet.component.UIComponent parent)

Sets the component properties and attributes corresponding to the tag handler's attributes. The default implementation sets the componentId, binding, rendered, and rendererType properties. Subclasses must call this implementation before processing the subclass-specific attributes.


public void setRendered(String rendered)

Sets an explicit value or a JSF expression value for the rendered property.


protected void setupResponseWriter()

Unless it's been done already, sets up the ResponseWriter for the current response.

ValidatorTag

This class is a base class for JSP tag handler class for actions that configures the component represented by the closest UIComponentTag parent tag handler with a Validator.

Synopsis

Class name:

javax.faces.webapp.ValidatorTag

Extends:

javax.servlet.jsp.tagext.TagSupport

Implements:

javax.servlet.jsp.tagext.IterationTag

Constructors


public ValidatorTag()

Creates an instance.

Methods


protected javax.faces.validator.Validator createValidator()

Returns a Validator, configured based on tag handler attribute values. An implementation of this method can be provided by a subclass. This implementation creates an instance of the converter identified by the validatorId attribute.


public int doStartTag()

Calls createValidator() to create a Validator and configures the component represented by the closest UIComponentTag parent tag handler to use if the component was created while processing the JSP page.


public void release()

Releases all references to acquired resources.


public void setValidatorId(String validatorId)

Sets the validatorId attribute.

    Previous Section  < Day Day Up >  Next Section