DOC

messagePresent

By Victor Webb,2014-10-09 10:22
8 views 0
messagePresent

    messagePresent

    计算在request, 一个ActionMessages对象, ActionErrors

    对象,一个String对象, 或一个String数组是否存在 , 或在某BEAN中的某个属性是否存在

    例子:

    <logic:messagesPresent

    name="org.apache.struts.action.ERROR">

    request中存在一个ActionErrors对象

    </logic:messagesPresent>

    <br>

    <logic:messagesPresent name="org.apache.struts.action.ACTION_MESSAGE"> request中存在一个ActionMessages对象

    </logic:messagesPresent>

    <BR>

    <logic:messagesPresent

    name="org.apache.struts.action.ACTION_MESSAGE"

    property="org.apache.struts.action.GLOBAL_MESSAGE"> request中存在一个ActionMessages对象, 并且对象中存在一

    org.apache.struts.action.GLOBAL_MESSAGE(ActionMessages.GL

    OBAL_MESSAGE)属性

    </logic:messagesPresent>

    <br>

    <logic:messagesPresent message="true">

     request中存在一个ActionMessages对象

    </logic:messagesPresent>

    <br>

    <logic:messagesPresent message="true"

    property="org.apache.struts.action.GLOBAL_MESSAGE">

     request中存在一个ActionMessages对象,并且对象中存在一

    org.apache.struts.action.GLOBAL_MESSAGE(ActionMessages.GL

    OBAL_MESSAGE)属性

</logic:messagesPresent>

    Since: Struts 1.1

    Evaluates the nested body content of this tag if an ActionMessages object, ActionErrors object, a String, or

    a String array is in request scope. If such a bean is not

    found, nothing will be rendered.

    Attribute Description Name

    By default the tag will retrieve the request scope

    bean it will iterate over from the Action.ERROR_KEY

    constant string, but if this attribute is set to

    'true' the request scope bean will be retrieved message from the Action.MESSAGE_KEY constant string. Also

    if this is set to 'true', any value assigned to the

    name attribute will be ignored.

    (RT EXPR)

    The parameter key to retrieve the message from

    request scope. name

    (RT EXPR)

    Name of the property for which messages should be

    retrieved. If not specified, all messages property (regardless of property) are retrieved.

    (RT EXPR)

Report this document

For any questions or suggestions please email
cust-service@docsford.com