-1

I have a code where I am trying to display a cross or tick based on the value of a object property in JSTL. The property is of type Boolean and I am getting a java.lang.NullPointerException thrown in the jsp. My code is as follows

 <c:if test="${gem==true}">
 <span class="glyphicon glyphicon-ok"></span>
 </c:if>

 <c:if test="${gem==false}">
 <span class="glyphicon glyphicon-remove"></span>
 </c:if>

Can anyone help me to resolve this?

Philomath
  • 1,145
  • 4
  • 18
  • 28

1 Answers1

0

Try using primitive boolean instead of Boolean else assign value to Boolean. By default Boolean Object value is null. Please refer: Default value of Boolean in java

Valath
  • 880
  • 3
  • 13
  • 35