|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
Message
public class Message
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 aPageContext
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.
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 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 |
---|
public static final String MESSAGE_ARG_KEY
Constructor Detail |
---|
public Message()
Method Detail |
---|
public String getTagName()
AbstractClassicTag
getTagName
in interface INetuiTag
getTagName
in class AbstractClassicTag
public void setResultId(String resultId)
pageScope
. If the value of this attribute
is foo
, the resulting message will be available with ${pageScope.foo}
.
public void setValue(Object value)
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.
public int doStartTag()
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class BodyTagSupport
JspException
public void addMessageArgument(Object messageArgument)
protected void localRelease()
AbstractClassicTag
localRelease
in class AbstractClassicTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |