| Author |
checking logic:match for multiple values
|
Jaya Swaminathan
Greenhorn
Joined: Jul 19, 2005
Posts: 17
|
|
|
Hi, I want to display a portion of the HTML if one form parameter has either of two values. I could use logic:match or logic:equal to check against one constant value. But I am not sure how i could check whether it is equal to either of the two values. Any help would be appreciated.
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
My advice would be to use JSTL for this. Here's an example: <c:if test='${myForm.prop1 == 'ABC' || myForm.prop1 == "XYZ"}'></c:if>
|
Merrill
Consultant, Sima Solutions
|
 |
Pranav Sharma
Ranch Hand
Joined: Oct 27, 2003
Posts: 254
|
|
use the jstl <%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%> or did u mean this
|
 |
Jaya Swaminathan
Greenhorn
Joined: Jul 19, 2005
Posts: 17
|
|
Hi, Thanks for ur response. I could not use JSTL because we are using older version of JSP and i cant upgrade. So I did this. I set a form attribute to true(used it as a flag) if the value is either of the two options and then used the logic:equal to check that the flag is set or not. It worked.
|
 |
 |
|
|
subject: checking logic:match for multiple values
|
|
|