java - Can jstl check if attribute has been added to the model? -
is possible check if attribute has been added model?
//in controller teh variable not added // model.addattribute("variable", myvariable);
and in jsp this
<c:choose> <c:when test="${variable present}"> not present </c:when> <c:otherwise> present </c:otherwise> </c:choose>
thanks
jstl/el cannot check if attribute has been added model. need implement observer/observable yourself.
el can check if bean property or map value not null or empty.
<c:when test="${not empty bean.property}">
<c:when test="${not empty map.key}">
Comments
Post a Comment