org.apache.beehive.netui.tags.databinding.message
Class Message

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by Message
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag

Deprecated. This tag has been deprecated in favor of the i18n tags available in JSTL.

public class Message
extends AbstractClassicTag

This tag provides a message schema, which can be parameterized to construct customizable messages. Curly-braces are used to identify argument place holders in the schema:

For example, the following will format a message and place the result in a PageContext attribute named message.

 <%
    pageContext.setAttribute("msgSkeleton", new String("Hello {0}. {1} {2}, the current date and time are {3}."));
 %>
 <netui-data:message value="${pageScope.msgSkeleton}" resultId="message">
 

The followingn example defines a message schema, while the MessageArg tags provide the parameters that plug values into the schema. In the following example, the <netui-data:message> tag uses the value attribute to bind to the message schema (which was earlier added to the javax.servlet.jsp.PageContext object. The two <netui-data:messageArg> tags provide the parameters to plug into the schema.

    <%
        pageContext.setAttribute("msgSkeleton", new String("To read about {0}, go to {1}."));
    %>
    ...
    <netui-data:message value="${pageScope.msgSkeleton}" resultId="message">
        <netui-data:messageArg value="messaging"/>
        <netui-data:messageArg value="my web page"/>
    </netui-data:message>
    ...
    <netui:span value="${pageScope.message}"/>

The following message is output to the JSP page:

     To read about messaging, go to my web page.
 

See Also:
Serialized Form
Example

The followingn example defines a message schema, while the MessageArg tags provide the parameters that plug values into the schema. In the following example, the <netui-data:message> tag uses the value attribute to bind to the message schema (which was earlier added to the javax.servlet.jsp.PageContext object. The two <netui-data:messageArg> tags provide the parameters to plug into the schema.

    <%
        pageContext.setAttribute("msgSkeleton", new String("To read about {0}, go to {1}."));
    %>
    ...
    <netui-data:message value="${pageScope.msgSkeleton}" resultId="message">
        <netui-data:messageArg value="messaging"/>
        <netui-data:messageArg value="my web page"/>
    </netui-data:message>
    ...
    <netui:span value="${pageScope.message}"/>

The following message is output to the JSP page:

     To read about messaging, go to my web page.
 


Field Summary
static String MESSAGE_ARG_KEY
          Deprecated.  
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
Message()
          Deprecated.  
 
Method Summary
 void addMessageArgument(Object messageArgument)
          Deprecated.  
 int doEndTag()
          Deprecated.  
 int doStartTag()
          Deprecated.  
 String getTagName()
          Deprecated. Return the name of the tag.
protected  void localRelease()
          Deprecated. This is a method that will reinitialize all temporary state on a tag and should be called in the doEndTag method.
 void setResultId(String resultId)
          Deprecated. Set the attribute name under which the output formatted message will be available.
 void setValue(Object value)
          Deprecated.  Set the object to use when formatting a message.
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Field Detail

MESSAGE_ARG_KEY

public static final String MESSAGE_ARG_KEY
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

Message

public Message()
Deprecated. 
Method Detail

getTagName

public String getTagName()
Deprecated. 
Description copied from class: AbstractClassicTag
Return the name of the tag. Used by error reporting to get the name of the tag.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractClassicTag
Returns:
the name of the tag.

setResultId

public void setResultId(String resultId)
Deprecated. 
Set the attribute name under which the output formatted message will be available. The message will be stored in the JSP EL implicit object pageScope. If the value of this attribute is foo, the resulting message will be available with ${pageScope.foo}.


setValue

public void setValue(Object value)
Deprecated. 

Set the object to use when formatting a message. This value should be either a String or be convertable to a String via its Object.toString() method. In ordet for format the message, this value should appear as:

     Hello, {0}!
 
where the {0} can be filled in during formatting via the MessageArg tag.


doStartTag

public int doStartTag()
Deprecated. 
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport

doEndTag

public int doEndTag()
             throws JspException
Deprecated. 
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException

addMessageArgument

public void addMessageArgument(Object messageArgument)
Deprecated. 

localRelease

protected void localRelease()
Deprecated. 
Description copied from class: AbstractClassicTag
This is a method that will reinitialize all temporary state on a tag and should be called in the doEndTag method.

Overrides:
localRelease in class AbstractClassicTag