Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSTL List contains functionality

843838Apr 24 2007 — edited Apr 24 2007
Hi:

Is it possible to check if an element exists within a List using the JSTL expression language?

Problem:
I have two lists, one subset of the other. The list is rendered as a table using the for-each core function. The elements which exists in both lists are to be displayed in red, while the others in white.

In Java we can do:
for(Object obj:list){
  ...
  if(selectedList.contains(obj)){
    // Display in red
  }else{
    // Display in white
  }
  ...
}
How can I do this using the JSTL expression language?

Albert
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2007
Added on Apr 24 2007
2 comments
960 views