There is if-else condition on my form where I show heading and button text for add and update.
Below code what I have used in struts2 project and same code want to use in JSF2 project in xhtml page.
Struts2 Page
<s:if test="person==null || person.id==null || person.id==''">
<s:set var="buttonText" value="getText('person.button.add')"/>
<s:text name="person.h1.add.text"/>
<i><s:text name="person.smallfont.add.text"/></i>
</s:if>
<s:else>
<s:set var="buttonText" value="getText('person.button.edit')"/>
<s:text name="person.h1.edit.text"/>
<s:text name="person.smallfont.edit.text"/>
</s:else>
I could use JSTL in xhtml page and use above code as it is but I saw different approaches for this like below using EL. I am not sure but don't like below approach
<h:outputLabel value="Add Information" rendered="#{!empty personBean.person.id}" />
<h:outputLabel value="Use the form below to add your information." rendered="#{!empty personBean.person.id}" />
<h:outputLabel value="Update Information" rendered="#{empty personBean.person.id}" />
<h:outputLabel value="Use the form below to edit your information." rendered="#{empty personBean.person.id}" />
My Question:
Someone guide me how to use above code in IF-ELSE condition in JSF project please. Use EL/JSTL or any other?