Skip to main content

JSF 2.0: ui:repeat vs. c:forEach?

2 replies [Last post]
martyhall
Offline
Joined: 2009-08-19

In JSF 1.x, c:forEach and c:if didn't play well when mixed with JSF tags due to the JSF lifecycle or differences in EL evaluation. For example, c:forEach and c:if wouldn't see the value of the local variable ("var") in h:dataTable.

I was under the impression that things are much better in JSF 2.0, but couldn't find details. Can someone point me to a place that explains how the JSTL tags play with JSF 2.0?

Thanks!

- Marty
JSF 2.0 Tutorial: http://www.coreservlets.com/JSF-Tutorial/jsf2/

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ryan Lubke

On 2/7/10 2:19 PM, webtier@javadesktop.org wrote:
> In JSF 1.x, c:forEach and c:if didn't play well when mixed with JSF tags due to the JSF lifecycle or differences in EL evaluation. For example, c:forEach and c:if wouldn't see the value of the local variable ("var") in h:dataTable.
>
> I was under the impression that things are much better in JSF 2.0, but couldn't find details. Can someone point me to a place that explains how the JSTL tags play with JSF 2.0?
>
There really isn't any change in behavior.

c:forEach/c:if execute during tree creation time while ui:repeat
executes during the render phase.

There's a very good blog detailing the differences here:
http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets
> Thanks!
>
> - Marty
> JSF 2.0 Tutorial: http://www.coreservlets.com/JSF-Tutorial/jsf2/
> [Message sent by forum member 'martyhall' (hall@coreservlets.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=385337
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

martyhall
Offline
Joined: 2009-08-19

Thanks! For some reason, I thought that things had changed. I appreciate your clueing me in and pointing me to Roger Keay's good posting on the subject.

Cheers-

- Marty
JSF 2.0 Tutorial: http://www.coreservlets.com/JSF-Tutorial/jsf2/