• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Range tag in struts

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have been using struts equal tag to check if a variable is equal to a specific value. What if i want to check a session variable contains a value 4,5,6,7. Right now in logic:Equal i can check only for one value. is there a possibility for checking equal to for multiple values.
Thanks
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is one of the many reasons why i (and many others) moved to JSTL instead of struts-logic and struts-bean libraries. you can try the logic:match tag to do substring matching, but it's not the cleanest/safest approach. one other alternative is to extend the logic:equal tag and do your own custom tag.
[ May 12, 2005: Message edited by: alan do ]
 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May i know which tag in JSTL is used to check for this type of condition
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you have a few values, you can do this...
<c:if test="${theValue == '4' || theValue == '5' || theValue == '6' || theValue == '7'}">
do this...
</c:if>

or you can do range
<c:if test="${theValue >= 4 && theValue <= 7}">
do that
</c:if>
[ May 14, 2005: Message edited by: alan do ]
 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic