This tag provides a message schema, which can be parameterized to construct customizable messages.
<netui-data:message
resultId="string_result"
value="expression_value" />
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="{pageContext.msgSkeleton}" resultId="message">
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="{pageContext.msgSkeleton}" resultId="message"> <netui-data:messageArg value="messaging"/> <netui-data:messageArg value="my web page"/> </netui-data:message> ... <netui:label value="{pageContext.message}"/>
The following message is output to the JSP page:
To read about messaging, go to my web page.