Using jstl I want to list each letter of the alphabet.
I want something like a b ... z
<c:set var="alphabet" value="A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" />
<c:forTokens var="letter" items="${alphabet}" delims=",">
${letter}
</c:forTokens>
Ok, no scriptlet. How about a JSP expression? If you don't want either of them, then you can create a custom EL function. Look near bottom of Hidden features of JSP/Servlet
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:forEach var="i" begin="97" end="122">
<%=Character.toChars((Integer)pageContext.getAttribute("i"))%>
</c:forEach>
Assuming you can inject java directly in (I don't know JSTL) you could do this
for(char letter = 'a'; letter <= 'z'; letter++) {
System.out.println(letter + " ");
}
keeping in mind that a char
is just an unsigned integer.