JSP useBean equivalent in JSF

Is it possible to declare a bean as a JSP UseBean in JSF?

for example if i am nested in VO object i don't want to call many get methods over and over again

For example, I have a ManagedBean (MB) running VO. VO hold (CVO), CVO Hold CVO1. if you want CVO methods. I need to write MB.VO.CVO.CVO1.method1, MB.VO.CVO.CVO1.method2. is there any simple approach to this, for example i define CVO1 and use it as CVO1.method1 and CVO1.method2?

+2


source to share


1 answer


If you are using JSTL you can use <c:set>

:



<c:set var="temp" value="#{myBean.someObject}"/>
...
<!-- Exemple of usage: -->
<h:outputText value="#{temp.someProperty}"/>

      

+1


source







All Articles