Category Archives: Uncategorized

JSTL vs. EL – What’s the Difference?

Expression Language (EL) is a way to create an expression on the Java objects, of the form a.b.c (which is equivalent to a.getB().getC(), or a.getB().isC(), etc. So, it is a way to create a readable expression of Java. A common use case, in JSP, you can write: ${user.name} which will write the Object/String returned by the bean user, using Java equivalent user.getName().

JSTL is the tag library. Such as <c:if> etc.

Using JSTL and EL together You can use JSTL and EL together, such as:


<c:if test="${user.active}">
Your account is active.
</c:if>

<c:if test="${not user.active}">
Your account is NOT active.
</c:if>

Here the c:if portion is JSTL and user.active part is EL.