public class JcmsMessage
extends java.lang.Object
In order for the message to be visible, JSP doMessageBox.jsp
must be
invoked, either in the current request when using JcmsContext.addMsg(javax.servlet.http.HttpServletRequest, JcmsMessage)
,
or in any request of the session when using JcmsContext.addMsgSession(javax.servlet.http.HttpServletRequest, JcmsMessage)
.
Example, when used inside any Java Bean or FormHandler extending JcmsContext
or any
of its subclass ( JcmsJspContext
, JcmsFormHandler
...) :
addMsg( new JcmsMessage(Level.WARN, glp("jcmsplugin.myplugin.msg.warn.missing-something")) );Example when used in any other class :
JcmsContext.addMsg(request, new JcmsMessage(Level.WARN, JcmsUtil.glp(userLang, "jcmsplugin.myplugin.msg.warn.missing-something")) );
Modifier and Type | Class and Description |
---|---|
static class |
JcmsMessage.Level
Criticity Level of message being displayed to the User.
|
Constructor and Description |
---|
JcmsMessage(JcmsMessage.Level level,
java.lang.String message)
Creates a new JcmsMessage with the specified level and message
|
JcmsMessage(java.lang.String id,
JcmsMessage.Level level,
java.lang.String message)
Creates a new JcmsMessage with the specified level and message, and
with a unique identifier.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getId()
Retrieves the id of this JcmsMessage, if any.
|
JcmsMessage.Level |
getLevel() |
java.lang.String |
getMessage() |
void |
setId(java.lang.String id) |
void |
setLevel(JcmsMessage.Level level) |
void |
setMessage(java.lang.String message) |
public JcmsMessage(JcmsMessage.Level level, java.lang.String message)
level
- the criticity levelmessage
- the message, must already be I18Nedpublic JcmsMessage(java.lang.String id, JcmsMessage.Level level, java.lang.String message)
id
- an identifier of this message, can be nulllevel
- the criticity levelmessage
- the message, must already be I18Nedpublic java.lang.String getId()
public void setId(java.lang.String id)
public JcmsMessage.Level getLevel()
public void setLevel(JcmsMessage.Level level)
public java.lang.String getMessage()
public void setMessage(java.lang.String message)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2001-2010 Jalios SA. All Rights Reserved.