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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -