I need to hide an element if certain values are present in the JSP
The values are stored in a List so I tried:
I found this solution amazing.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
ArrayList list = new ArrayList();
list.add("one");
list.add("two");
list.add("three");
%>
My list is ${list}
My list contains two
My list contains ,
The output for the code above is
My list is [one, two, three]
My list contains two
My list contains ,
I hope it helps someone.