If you are using EL 2.2 (part of Servlet 3.0) or JBoss EL, then you should just call this method in EL.
<h:panelGroup rendered="#{patientNotePrescriptionVar.prescriptionSchedule.equalsIgnoreCase(patientNotePresBackingBean.sendPrescription)}">
If you are not already in EL 2.2, then the best option would be to pass both lines through JSTL fn:toLowerCase()
(or fn:toUpperCase()
), and then compare it.
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> ... <h:panelGroup rendered="#{fn:toLowerCase(patientNotePrescriptionVar.prescriptionSchedule) == fn:toLowerCase(patientNotePresBackingBean.sendPrescription)}">
It would be better, however, not to make them case sensitive. If they represent any constants, it is better to make them enumerations or something else.
source share