|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.tag.StripesTagSupport
net.sourceforge.stripes.tag.HtmlTagSupport
net.sourceforge.stripes.tag.MessagesTag
public class MessagesTag
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
FlashScope
which causes them to be exposed as
request attributes in both the current and subsequent request (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:
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.
Field Summary | |
---|---|
static String |
DEFAULT_FOOTER
The footer that will be emitted if no footer is defined in the resource bundle. |
static String |
DEFAULT_HEADER
The header that will be emitted if no header is defined in the resource bundle. |
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport |
---|
pageContext, parentTag |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
MessagesTag()
|
Method Summary | |
---|---|
int |
doEndTag()
Outputs the set of messages appropriate for this tag. |
int |
doStartTag()
Does nothing, all processing is performed in doEndTag(). |
String |
getKey()
Gets the key that will be used to scope search for messages to display. |
protected List<Message> |
getMessages()
Gets the list of messages that will be displayed by the tag. |
void |
setKey(String key)
Sets the key that will be used to scope search for messages to display. |
Methods inherited from class net.sourceforge.stripes.tag.HtmlTagSupport |
---|
evaluateExpression, get, getAccesskey, getAttributes, getBodyContent, getBodyContentAsString, getCssClass, getDir, getId, getLang, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getStyle, getTabindex, getTitle, release, set, setAccesskey, setBodyContent, setClass, setCssClass, setDir, setDynamicAttribute, setId, setLang, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setStyle, setTabindex, setTitle, toString, writeAttributes, writeCloseTag, writeOpenTag, writeSingletonTag |
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport |
---|
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, setPageContext, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_HEADER
public static final String DEFAULT_FOOTER
Constructor Detail |
---|
public MessagesTag()
Method Detail |
---|
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class StripesTagSupport
JspException
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class StripesTagSupport
JspException
public String getKey()
public void setKey(String key)
protected List<Message> getMessages()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |