Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Clarification regarding some core taglib usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Clarification regarding some core taglib usage" Watch "Clarification regarding some core taglib usage" New topic
Author

Clarification regarding some core taglib usage

Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

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?

~ Mansukh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

(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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

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..
 
 
subject: Clarification regarding some core taglib usage
 
Similar Threads
EL expressions not evaluating
According to TLD or attribute directive in tag file, attribute value does not accept any expressions
Doubt on Tags
Best choice for pagination?
Iterating through local List using JSTL