Is there any isset-like function in JSP?

jsp, undefined, variables

Solution

<c:if test="${name == null}">variable name is undefined</c:if>

For testing you can define and undefine a variable using:

<c:set var="name" value="Petra"/>
<c:set var="name" value="${null}"/>

To state you are using the core JSTL tags add this to the top of the page:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

Problem

I was wondering if we could check for all `undefined` and `null` variables in JSP using its built-in functions? I know I can build a function to do that, but I need a lazy solution.

Original source

Related problems