I'm working on a web application using Java and its frameworks(Spring 3.1.1). And I'm trying to avoid using scriptlets as much as possible, however I can't find a way other than this to define an array:
<%
String[] alphabet = {"A", "B", "C", ... , "Z"};
pageContext.setAttribute("alphabet", alphabet);
%>
After setting pageContext attribute, I can use it with ${alphabet}
. But I want to know, is it possible to use plain JSTL/EL to create an array?
UPDATE: I'm using this array to create links. For example, if user clicks 'S', a list of employees whose first name starts with 'S' comes. So, instead of creating links one by one I'm iterating ${alphabet}
.
@WebListener
work on Java EE 5? – Silverplate