• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is equivalent of c:forEach in jsf?  RSS feed

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post.
can some one tell me what is equivalent of c:forEach in jsf?
thanks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't one. Though I believe you can use JSTL on a limited basis with JSF. Not 100% sure. JSF components that might require c:forEach (like created a data table) are done in the component tag itself, ie, JSF's DataTable.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
forEach is an iterative construct. Iteration is a logical process. In JSF, the separation between model, view and controller is much more rigorous than in most similar frameworks. Thus, instead of a loop declaration bounding display elements, there are display elements of collections with the looping being handled by the controller.

It can be restrictive, but on the other hand, it's difficult enough to debug logic on plain JSPs, much less the more sophisticated sort of constructs that JSF is intended to support.

The compensation is that your logic is therefore constrained to either be in simple JavaBeans (the backing beans) - which can normally be unit-tested and otherwise debugged without needing to fire up an appserver. OR, the logic is pre-debugged and built into the framework, like the datatable controller.
 
Hung Tang
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Facelets for JSF comes with limited support for JSTL that includes c:forEach.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!