org.apache.struts.taglib.bean
Class WriteTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.apache.struts.taglib.bean.WriteTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
NestedWriteTag

public class WriteTag
extends javax.servlet.jsp.tagext.TagSupport

Tag that retrieves the specified property of the specified bean, converts it to a String representation (if necessary), and writes it to the current output stream, optionally filtering characters that are sensitive in HTML.

Version:
$Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
See Also:
Serialized Form

Field Summary
protected  java.lang.String bundle
          The servlet context attribute key for our resources.
static java.lang.String DATE_FORMAT_KEY
          The key to search default format string for java.util.Date in resources.
protected  boolean filter
          Filter the rendered output for characters that are sensitive in HTML?
static java.lang.String FLOAT_FORMAT_KEY
          The key to search default format string for float (double, BigDecimal) in resources.
protected  java.lang.String formatKey
          The key to search format string in applciation resources
protected  java.lang.String formatStr
          The format string to be used as format to convert value to String.
protected  boolean ignore
          Should we ignore missing beans and simply output nothing?
static java.lang.String INT_FORMAT_KEY
          The key to search default format string for int (byte, short, etc.) in resources.
protected  java.lang.String localeKey
          The session scope key under which our Locale is stored.
protected static MessageResources messages
          The message resources for this package.
protected  java.lang.String name
          Name of the bean that contains the data we will be rendering.
protected  java.lang.String property
          Name of the property to be accessed on the specified bean.
protected  java.lang.String scope
          The scope to be searched to retrieve the specified bean.
static java.lang.String SQL_DATE_FORMAT_KEY
          The key to search default format string for java.sql.Date in resources.
static java.lang.String SQL_TIME_FORMAT_KEY
          The key to search default format string for java.sql.Time in resources.
static java.lang.String SQL_TIMESTAMP_FORMAT_KEY
          The key to search default format string for java.sql.Timestamp in resources.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext, parent, values
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
WriteTag()
           
 
Method Summary
 int doStartTag()
          Process the start tag.
protected  java.lang.String formatValue(java.lang.Object valueToFormat)
          Format value according to specified format string (as tag attribute or as string from message resources) or to current user locale.
 java.lang.String getBundle()
           
 boolean getFilter()
           
 java.lang.String getFormat()
           
 java.lang.String getFormatKey()
           
 boolean getIgnore()
           
 java.lang.String getLocale()
           
 java.lang.String getName()
           
 java.lang.String getProperty()
           
 java.lang.String getScope()
           
 void release()
          Release all allocated resources.
protected  java.lang.String retrieveFormatString(java.lang.String formatKey)
          Retrieve format string from message bundle and return null if message not found or message string.
 void setBundle(java.lang.String bundle)
           
 void setFilter(boolean filter)
           
 void setFormat(java.lang.String formatStr)
           
 void setFormatKey(java.lang.String formatKey)
           
 void setIgnore(boolean ignore)
           
 void setLocale(java.lang.String localeKey)
           
 void setName(java.lang.String name)
           
 void setProperty(java.lang.String property)
           
 void setScope(java.lang.String scope)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SQL_TIMESTAMP_FORMAT_KEY

public static final java.lang.String SQL_TIMESTAMP_FORMAT_KEY
The key to search default format string for java.sql.Timestamp in resources.

SQL_DATE_FORMAT_KEY

public static final java.lang.String SQL_DATE_FORMAT_KEY
The key to search default format string for java.sql.Date in resources.

SQL_TIME_FORMAT_KEY

public static final java.lang.String SQL_TIME_FORMAT_KEY
The key to search default format string for java.sql.Time in resources.

DATE_FORMAT_KEY

public static final java.lang.String DATE_FORMAT_KEY
The key to search default format string for java.util.Date in resources.

INT_FORMAT_KEY

public static final java.lang.String INT_FORMAT_KEY
The key to search default format string for int (byte, short, etc.) in resources.

FLOAT_FORMAT_KEY

public static final java.lang.String FLOAT_FORMAT_KEY
The key to search default format string for float (double, BigDecimal) in resources.

messages

protected static MessageResources messages
The message resources for this package.

filter

protected boolean filter
Filter the rendered output for characters that are sensitive in HTML?

ignore

protected boolean ignore
Should we ignore missing beans and simply output nothing?

name

protected java.lang.String name
Name of the bean that contains the data we will be rendering.

property

protected java.lang.String property
Name of the property to be accessed on the specified bean.

scope

protected java.lang.String scope
The scope to be searched to retrieve the specified bean.

formatStr

protected java.lang.String formatStr
The format string to be used as format to convert value to String.

formatKey

protected java.lang.String formatKey
The key to search format string in applciation resources

localeKey

protected java.lang.String localeKey
The session scope key under which our Locale is stored.

bundle

protected java.lang.String bundle
The servlet context attribute key for our resources.
Constructor Detail

WriteTag

public WriteTag()
Method Detail

getFilter

public boolean getFilter()

setFilter

public void setFilter(boolean filter)

getIgnore

public boolean getIgnore()

setIgnore

public void setIgnore(boolean ignore)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getProperty

public java.lang.String getProperty()

setProperty

public void setProperty(java.lang.String property)

getScope

public java.lang.String getScope()

setScope

public void setScope(java.lang.String scope)

getFormat

public java.lang.String getFormat()

setFormat

public void setFormat(java.lang.String formatStr)

getFormatKey

public java.lang.String getFormatKey()

setFormatKey

public void setFormatKey(java.lang.String formatKey)

getLocale

public java.lang.String getLocale()

setLocale

public void setLocale(java.lang.String localeKey)

getBundle

public java.lang.String getBundle()

setBundle

public void setBundle(java.lang.String bundle)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process the start tag.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

retrieveFormatString

protected java.lang.String retrieveFormatString(java.lang.String formatKey)
                                         throws javax.servlet.jsp.JspException
Retrieve format string from message bundle and return null if message not found or message string.
Parameters:
formatKey - value to use as key to search message in bundle
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

formatValue

protected java.lang.String formatValue(java.lang.Object valueToFormat)
                                throws javax.servlet.jsp.JspException
Format value according to specified format string (as tag attribute or as string from message resources) or to current user locale. When a format string is retrieved from the message resources, applyLocalizedPattern is used. For more about localized patterns, see . (To obtain the correct value for some characters, you may need to view the file in a hex editor and then use the Unicode escape form in the property resources file.)
Parameters:
valueToFormat - value to process and convert to String
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

release

public void release()
Release all allocated resources.
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport


Copyright 2000-2006 - The Apache Software Foundation