Another way is to create an abstract method in a base class, which will return you some mark of what instance you have, and implement it in your subclasses, like this:
public abstract class Person {
public abstract boolean isPhysical();
}
public PhysicalPerson extends Person {
public boolean isPhysical() {
return true;
}
}
and then in jsf:
<h:panelGroup rendered="#{entity.physical}">
<p>this is a PhysicalPerson.</p>
</h:panelGroup>
<h:panelGroup rendered="#{ not entity.physical}">
<p>this is a Moral Person.</p>
</h:panelGroup>
However the class checking approach is more universal.