• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"page" Implicit object

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Could anyone tell me whats the use of the "Page" Implicit object in JSPs.


Thanks in advance,
Ganesh
 
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there.
The page implicit object is something which you can bind attributes to... it's another scope which JSPs can use. Don't confuse it with the pageContext object, which is an object that has convience methods like getRequest(), getSession(), getPage(), getAttribute(String name, int scope), findAttribute(), etc.
The pageContext implicit object is of type PageConetext (which extends JspContext), and the page variable is of type Object (well at least at compile time), but it actually receives a reference to the actual servlet which is executing the _jspService() method).

Regards,
Mars.
[ February 28, 2006: Message edited by: Marcelo Ortega ]
 
Ganesh.P Ram
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.
So "page" is like an implicit "this" reference to the servlet.
So I can access all the instance variables and methods in that servlet..I can also pass the "this" ref to some other method.
Is my understanding right ?
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The page implicit object is something which you can bind attributes to... it's another scope which JSPs can use.



The "page" scoped attributes are not binded with the page Object. The page is of type Object, which holds reference of current Servlet object.

The "page" scope attributes are stored in pageContex object not in page Object.

Pl. Correct me if wrong.

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic