Some combinations of is/get-getters, Boolean/boolean fields and Boolean/boolean getters are allowed or forbidden by JSP. It is as follows:
Forbidden combinations:
Boolean method, getting by is
Allowed combinations:
Boolean method, getting by get
boolean method, getting by is
boolean method, getting by get
Boolean/boolean type of field is irrelevant.
In IntelliJ it is enough to generate getters automatically.
Checked by launching all combinations.
<c:if test="${actionBean.code_FMI}">
<div>Boolean field, Boolean method, getting by is</div>
</c:if>
<c:if test="${actionBean.code_FMG}">
<div>Boolean field, Boolean method, getting by get</div>
</c:if>
<c:if test="${actionBean.code_FmI}">
<div>Boolean field, boolean method, getting by is</div>
</c:if>
<c:if test="${actionBean.code_FmG}">
<div>Boolean field, boolean method, getting by get</div>
</c:if>
<c:if test="${actionBean.code_fMI}">
<div>boolean field, Boolean method, getting by is</div>
</c:if>
<c:if test="${actionBean.code_fMG}">
<div>boolean field, Boolean method, getting by get</div>
</c:if>
<c:if test="${actionBean.code_fmI}">
<div>boolean field, boolean method, getting by is</div>
</c:if>
<c:if test="${actionBean.code_fmG}">
<div>boolean field, boolean method, getting by get</div>
</c:if>
Java bean:
private Boolean code_FMI = true, code_FmI = true, code_FMG = true, code_FmG = true;
private boolean code_fMI = true, code_fmI = true, code_fMG = true, code_fmG = true;
public Boolean isCode_FMI() {
return code_FMI;
}
public boolean isCode_FmI() {
return code_FmI;
}
public Boolean getCode_FMG() {
return code_FMG;
}
public boolean getCode_FmG() {
return code_FmG;
}
public Boolean isCode_fMI() {
return code_fMI;
}
public boolean isCode_fmI() {
return code_fmI;
}
public Boolean getCode_fMG() {
return code_fMG;
}
public boolean getCode_fmG() {
return code_fmG;
}
private
in yourvalid
object variable declaration mean you can't access it directly? – EmblazonmentisValid()
, it doesn't work as well? – EmblazonmentgetValid()
method that delegates toisValid()
, it should work. – Chare