JSF and JSTL have access to boxed objects (Boolean, Integer, etc.) directly. There is no need to unpack, so you do not need to call booleanValue ().
<c:if test="${sV.done}">...</c:if>
But in fact, your whole approach could be better - I do not display the parameters on the page without a list of options and values. I donβt write out cycles and selection tests manually every time, there are tags or you can write a way for this.
Super tip: I have a class called Pair (string name, Object value) and the library method HtmlUI.renderSelectOptions () to deduce SELECT parameters from their list and the value "current".
Choose a combo box, maybe not the best view for a boolean? You can check the box. But it depends on your user interface design.
If you want to go this way, you can only switch the SELECTED attribute inside the tag. Easier than duplicating code for everything, key and value. For legacy code, I have a function that also fulfills this exact requirement :)
Hope this helps! Chase me away.
Thomas w
source share