Package com.jalios.jcms.context
Class JcmsMessage
java.lang.Object
com.jalios.jcms.context.JcmsMessage
Wrapper class for message(s) to be displayed to the user in the GUI.
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")) );
- Since:
- jcms-7.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCriticity Level of message being displayed to the User. -
Constructor Summary
ConstructorsConstructorDescriptionJcmsMessage(JcmsMessage.Level level, String message) Creates a new JcmsMessage with the specified level and messageJcmsMessage(String id, JcmsMessage.Level level, String message) Creates a new JcmsMessage with the specified level and message, and with a unique identifier. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()Retrieves the id of this JcmsMessage, if any.getLevel()voidvoidsetLevel(JcmsMessage.Level level) voidsetMessage(String message) toString()
-
Constructor Details
-
JcmsMessage
Creates a new JcmsMessage with the specified level and message- Parameters:
level- the criticity levelmessage- the message, must already be I18Ned
-
JcmsMessage
Creates a new JcmsMessage with the specified level and message, and with a unique identifier.- Parameters:
id- an identifier of this message, can be nulllevel- the criticity levelmessage- the message, must already be I18Ned
-
-
Method Details