org.opensubsystems.core.www
Class MessageTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.opensubsystems.core.www.MessageTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class MessageTag
extends javax.servlet.jsp.tagext.TagSupport

Custom tag to display messages defined using call to CallContext.getInstance().getMessages().addXYZ() on the UI processed using servlet derived from WebUIServlet. Place this tag in your JSP page at the place where you want to display informational or error messages generated by application for the user. This tag will generate DIV element with informational and error messages in it that you can format using CSS. The default css classes for this tag are included in <%=contextpath%>/core/css/message.css. If you do not specify your own css styles, you should include this default css file whenever you use this tag.

Version:
$Id: MessageTag.java,v 1.10 2007/01/07 06:14:09 bastafidli Exp $
Author:
Miro Halas
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.7 2006/02/17 06:54:09 bastafidli

Field Summary
protected  java.lang.String m_strCssclass
          Class for the message labels.
protected  java.lang.String m_strEmpty
          Flag signaling to also include the message area if the area would be empty.
protected  java.lang.String m_strId
          Id of the DIV where messages will be displayed.
static java.lang.String MESSAGES_REQUEST_PARAM
          Messages collected during processing of current request.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
MessageTag()
          Constructor for custom tag.
 
Method Summary
 int doEndTag()
          
 int doStartTag()
          
 java.lang.String getCssclass()
           
 java.lang.String getEmpty()
           
 java.lang.String getId()
           
 boolean isEmptyArea()
           
 void setCssclass(java.lang.String string)
           
 void setEmpty(boolean bEmpty)
           
 void setEmpty(java.lang.String strEmpty)
           
 void setId(java.lang.String string)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGES_REQUEST_PARAM

public static final java.lang.String MESSAGES_REQUEST_PARAM
Messages collected during processing of current request.

See Also:
Constant Field Values

m_strId

protected java.lang.String m_strId
Id of the DIV where messages will be displayed. Subarea where error messages are displayed will have id created by appending error and subarea for information messages will have id created by appending info. Required.


m_strCssclass

protected java.lang.String m_strCssclass
Class for the message labels.


m_strEmpty

protected java.lang.String m_strEmpty
Flag signaling to also include the message area if the area would be empty. If the message area should be included even if it is empty this should say true or 1.

Constructor Detail

MessageTag

public MessageTag()
Constructor for custom tag.

Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

getId

public java.lang.String getId()
Overrides:
getId in class javax.servlet.jsp.tagext.TagSupport
Returns:
String - Id of the DIV where messages will be displayed. Subarea where error messages are displayed will have id created by appending error and subarea for information messages will have id created by appending info.

getCssclass

public java.lang.String getCssclass()
Returns:
String - CSS class for the area where messages are displayed. Subarea where error messages are displayed will have class created by appending Error and subarea for information messages will have class created by appending Info

setId

public void setId(java.lang.String string)
Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport
Parameters:
string - - Id of the DIV where messages will be displayed. Subarea where error messages are displayed will have id created by appending error and subarea for information messages will have id created by appending info.

setCssclass

public void setCssclass(java.lang.String string)
Parameters:
string - - CSS class for the area where messages are displayed. Subarea where error messages are displayed will have class created by appending Error and subarea for information messages will have class created by appending Info.

getEmpty

public java.lang.String getEmpty()
Returns:
String - If the message area should be included even if it is empty this should say true or 1.

setEmpty

public void setEmpty(java.lang.String strEmpty)
Parameters:
strEmpty - - If the message area should be included even if it is empty this should say true or 1.

setEmpty

public void setEmpty(boolean bEmpty)
Parameters:
bEmpty - - If the message area should be included even if it is empty this should say true or 1.

isEmptyArea

public boolean isEmptyArea()
Returns:
boolean - true if the message area should be included even if empty


Copyright © 2003 - 2006 OpenSubsystems s.r.o.