netui-data
netui-data:message Tag
This tag provides a message schema, which can be parameterized to construct customizable messages.
<netui-data:message
resultId="string_result"
value="expression_value" >
... JSP content ...
</netui-data: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:
<%
pageContext.setAttribute("msgSkeleton", new String("Hello {0}. {1} {2}, the current date and time are {3}."));
%>
<netui-data:message value="${pageScope.msgSkeleton}" resultId="message">
Attributes |
resultId |
Required: Yes | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
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} . |
value |
Required: Yes | Type:
String |
Supports runtime evaluation / JSP Expression Language: Yes |
Set the object to use when formatting a message. This value should be either a String or be convertable
to a String via its java.lang.Object.toStringtoString() 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 <netui-data:messageArg> tag.
|
The followingn example defines a message schema, while the org.apache.beehive.netui.tags.databinding.message.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.
Tag Information |
Tag Class | org.apache.beehive.netui.tags.databinding.message.Message |
TagExtraInfo Class | None |
Body Content | JSP |
Display Name | None |