| < Day Day Up > |
|
The <logic:notMatch /> tag evaluates its body if the variable specified by any one of the attributes cookie, header, name, parameter, or property does not contain the constant specified by the value attribute. The <logic:notMatch /> tag has a body type of JSP and supports eight attributes, described in Table 18.12.
Attribute | Description |
---|---|
value | Identifies the constant value to which the scripting variable will be compared. (Required) |
location | Specifies where the match should occur in the named variable. The possible values are start and end. If the location attribute is not specified, then the value can occur anywhere in the variable. (Optional) |
cookie | Specifies an HTTP cookie to be used as the variable being compared to the value attribute. (Optional) |
header | Specifies an HTTP header to be used as the variable being compared to the value attribute. (Optional) |
name | Specifies a scripting variable to be used as the variable being compared to the value attribute. (Required) |
property | Specifies the data member of the scripting variable to be tested. (Optional) |
parameter | Specifies an HTTP parameter to be used as the variable being compared to the value attribute. (Optional) |
scope | Defines the scope of the bean specified by the name attribute. If the scope attribute is not specified, then the tag will search for the bean in the scopes, in the order of page, request, session, and application. (Optional) |
An example of using the <logic:notMatch /> tag is shown here:
<logic:notMatch name="sentence" value="Bob"> The string Bob does not occur in the sentence. </logic:notMatch >
In this example, we test the scripting variable sentence. If it does not contain the text Bob, then the tag's body will be evaluated.
| < Day Day Up > |
|