File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checking logic:match for multiple values

 
Jaya Swaminathan
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My advice would be to use JSTL for this. Here's an example:

<c:if test='${myForm.prop1 == 'ABC' || myForm.prop1 == "XYZ"}'></c:if>
 
Pranav Sharma
Ranch Hand
Posts: 258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the jstl
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>



or did u mean this

 
Jaya Swaminathan
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic