<%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> Test struts-logic Comparison Tags

Test struts-logic Comparison Tags

<% String bool1 = "true"; String bool2 = "false"; String str1 = "This is a string"; String str2 = "Less than"; String str3 = "XYZ greater than"; %>
Test Type Variable Content Value Content Correct Value Test Result
boolean / EQ <%= bool1 %> equal equal notEqual
boolean / EQ <%= bool2 %> equal equal notEqual
boolean / NE <%= bool2 %> notEqual equal notEqual
boolean / NE <%= bool1 %> notEqual equal notEqual
string / EQ <%= str1 %> equal greaterEqual lessEqual equal greaterEqual greaterThan lessEqual lessThan notEqual
string / GT <%= str2 %> greaterEqual greaterThan notEqual equal greaterEqual greaterThan lessEqual lessThan notEqual
string / LT <%= str3 %> lessEqual lessThan notEqual equal greaterEqual greaterThan lessEqual lessThan notEqual
string / NULL     equal greaterEqual lessEqual equal greaterEqual greaterThan lessEqual lessThan notEqual