• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check value in list using s:if

 
shwetank sharma
Greenhorn
Posts: 10
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have set an arraylist in session

Now i want to check for some value in that list and then only display the link.

The approach which is working is to iterate the list in session and check for that value

for eg,



but i need to check value and show link many a times so iterating everytime over same object doesn't looks good...moreover i also cannot use many time <s:if> for each check within iterator due to design constraint..

what i was looking was something like if i can directly use if without iterator



but this approach isn't working...

Looking forward for your inputs..

Thanks in advance..

Cheers,
Shwetank
 
Joe Ess
Bartender
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OGNL never clicked with me, so whenever I find myself with a complex condition that I'd like to use in an if tag, I make the condition a property of the action. Then the OGNL for the if tag is simple and I can evaluate the condition in easy-to-understand Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic