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}"> 

see also:


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -