• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clarification regarding some core taglib usage

 
Mansukhdeep Thind
Ranch Hand
Posts: 1158
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I created a jsp file with the following code:




The output is :

The forEach tag exposes a scoped variable called 'count', which is the position of the current element within the collection.
Family member #1 is Joe
Family member #2 is Rosy
Family member #3 is Petter
Family member #4 is Rob

I have the following queries:

a) From where are these numbers(1,2,3..) getting generated? What is the meaning of status.count? What is count?

b) Secondly, what is the meaning of ${pageScope.names}? Can't I simple write ${names} and pass the values in the String array? Where is this pageScope object coming from?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(a) Look up varStatus in the JSTL Specification. It references an object that contains information about the iteration status.

(b) By specifying pageScope, the search for the scoped variable is limited to page scope. Otherwise, the search spans all the scoped.
 
Mansukhdeep Thind
Ranch Hand
Posts: 1158
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:(a) Look up varStatus in the JSTL Specification. It references an object that contains information about the iteration status.

(b) By specifying pageScope, the search for the scoped variable is limited to page scope. Otherwise, the search spans all the scoped.



Thanks man..
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic