Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass a value to end attribute of <c:forEach />  RSS feed

 
raju chi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to print no. of Text fields dynamically by using <c:forEach />.
How to pass a value to end attribute?
Is there any alternate for <c:forEach/>
Please help me.



thanks in advance....,
 
Stefan Evans
Bartender
Posts: 1836
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard tag for looping in JSF would be the <h:dataTable>

If you want "x" text fields on the page, on your backing bean, have a list initialized to size "x", and then loop through it with the dataTable tag.
It should then automatically bind the values back into that same list in the bean.

 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Evans wrote:The standard tag for looping in JSF would be the <h:dataTable>


Nope. I'm going to be pedantic here. A dataTable is a 2-dimensional display structure. HOW it gets generated is immaterial. It could have just as easily been done via parallel processing for all the final display cares. Looping is just one way.

The reason for being so nit-picky about such stuff is that when you think solely in terms of logic, your solutions will tend to be colored in terms of logic. Don't mistake the means for the goal!

And (as I've said before) for a long an happy life, DON'T mix JSTL and JSF!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!