Stripes Tag Library
Tag messages
Displays a list of non-error messages to the user. The list of messages can come from
either the request (preferred) or the session (checked 2nd). Lists of messages can be stored
under any arbitrary key in request or session and the key can be specified to the messages
tag. If no key is specified then the default key (and therefore default set of messages) is
used. Note that by default the ActionBeanContext stores messages in a flash scope which
causes them to be exposed as request attributes in both the current and subsequent requests
(assuming a redirect is used).
While similar in concept to the ErrorsTag, the MessagesTag is significantly simpler. It deals
with a List of Message objects, and does not understand any association between messages and
form fields, or even between messages and forms. It is designed to be used to show arbitrary
messages to the user, the prime example being a confirmation message displayed on the subsequent
page following an action.
The messages tag outputs a header before the messages, the messages themselves, and a footer
after the messages. Default values are set for each of these four items. Different values
can be specified in the error messages resource bundle (StripesResources.properties unless you
have configured another). The default configuration would look like this:
- stripes.messages.header=<ul class="messages">
- stripes.messages.footer=</ul>
- stripes.messages.beforeMessage=<li>
- stripes.messages.afterMessage=</li>
It should also be noted that while the errors tag supports custom headers and footers
through the use of nested tags, the messages tag does not support this. In fact the
messages tag does not support body content at all - it will simply be ignored.
Tag Information |
Tag Class | net.sourceforge.stripes.tag.MessagesTag |
TagExtraInfo Class | None |
Body Content | empty |
Display Name | messages |
Attributes |
Name | Required | Request-time | Type | Description |
key | false | true | java.lang.String |
The name of the request or session attribute that the tag will use to find
messages for display.
|
Variables |
No Variables Defined. |
Output Generated by
Tag Library Documentation Generator.
Java, JSP, and JavaServer Pages are trademarks or
registered trademarks of Sun Microsystems, Inc. in the US and other
countries. Copyright 2002-4 Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054, U.S.A.
All Rights Reserved.