DOC

notEqual

By Steven Lawson,2014-10-09 10:22
8 views 0
notEqual

<%

     Person person = new Person();

     person.setName("Toms");

     person.setAge("23");

     person.setGreat(true);

     request.setAttribute("toms", person);

     request.setAttribute("years", 21); %>

    <!--使用name,比较简单变量-->

    <logic:notEqual name="years" value="21">

     years is 21

    </logic:notEqual>

    <br>

    --使用name, property的组合--> <!

    <logic:notEqual name="toms" property="name" value="Toms">

     name notEquals

    </logic:notEqual>

    <br>

    <logic:notEqual name="toms" property="great" value="true">

     greate notEquals

    </logic:notEqual>

    <br>

    <logic:notEqual name="toms" property="name" value="${'Toms'}">

     name notEquals

    </logic:notEqual>

    <br>

    <logic:notEqual name="toms" property="name" value="<%="Toms"%>">

     name notEquals

    </logic:notEqual>

    <br>

    <!--比较url传入的参数, 如果参数中指定多个相同的名字, 使用第一个参数-->

    <logic:notEqual parameter="country" value="Spanish">

     The country is Spanish

    </logic:notEqual>

    <br>

<!--比较header-->

    <logic:notEqual header="host" value="localhost">

     I known the host name

    </logic:notEqual>

    <br>

<!--比较cookie-->

    <%

    response.addCookie(new Cookie("ip", "127.0.0.1")); %>

    <logic:notEqual cookie="ip" value="127.0.0.1">

     I know the ip

    </logic:notEqual>

    notEqual - Evaluate the nested body content of this tag if the requested variable is not equal to the specified value. Compares the variable specified by one of the selector attributes against the specified constant value. The nested body content of this tag is evaluated if the variable and value are not equal. Attribute Description Name

    The variable to be compared is the value of the cookie

    whose name is specified by this attribute. cookie

    [RT Expr]

    The variable to be compared is the value of the header

    whose name is specified by this attribute. The name match header is performed in a case insensitive manner.

    [RT Expr]

    The variable to be compared is the JSP bean specified by

    this attribute, if property is not specified, or the value

    of the specified property of this bean, if property is name specified.

    [RT Expr]

    The variable to be compared is the first, or only, value

    of the request parameter specified by this attribute. parameter

    [RT Expr]

    The variable to be compared is the property (of the bean

    specified by the name attribute) specified by this

    attribute. The property reference can be simple, nested, property and/or indexed.

    [RT Expr]

    scope The bean scope within which to search for the bean named

    Attribute Description Name

    by the name property, or "any scope" if not specified.

    [RT Expr]

    The constant value to which the variable, specified by

    other attribute(s) of this tag, will be compared. value

    [Required] [RT Expr]

Report this document

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