views:

486

answers:

1

Hello,

Is there any way can declare a bean in just like JSP UseBean in JSF?

for example if i have nested objected inside a VO, I don't want to call to many get methods again and again

For Example i have ManagedBean(MB) hold VO. VO hold (CVO), CVO Hold CVO1. if want methods of CVO. i need to write MB.VO.CVO.CVO1.method1, MB.VO.CVO.CVO1.method2. is there any simple approach to this like i define CVO1 and use it as CVO1.method1 and CVO1.method2?

A: 

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

<c:set var="temp" value="#{myBean.someObject}"/>
...
<!-- Exemple of usage: -->
<h:outputText value="#{temp.someProperty}"/>
romaintaz
is C:set supported by facelets and JSF 1.2 ?
SomaSekhar
I've worked on a project that used JSF 1.2, Facelets, Richfaces, Tomahawk and JSTL (yes, at the same time ;) ) ! So I guess yes. However, I read that sometimes Facelets and JSTL have some incompatibilities, but I never had problems with that...
romaintaz