jsp - Check in EL if array contains specific element -


this question has answer here:

is there way check if expected element present in array in el? don't see other way other iterate whole array , see if value matches expected one.

if using spring framework, can use spring taglib + spel , common-lang3:

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> --- <spring:eval var="containsvalue" expression="t(org.apache.commons.lang3.arrayutils).contains(yourarray, 'expectedelement')" /> contains (true or false): ${containsvalue} 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -