Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

explanation in Jwebplus

Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question ID :999996821890
You have declared a useBean tag as:
<jsp:useBean id="man" class="animal.Human"/>
In which class of object will this bean be kept?

the answer is PageContext.

but in explanation, it has:
page : PageContext (this)
request : ServletRequest
session : HttpSession
application : ServletContext

I think pageContext is not equals to "this" in JSP ...
am i right??

Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually page is of type Object and is the 'this' to the jsp page. If you look at the java code for a jsp page, you always see at the start of the service method
Object page = this;
PageContext is an Object that acts as the container for a jsp page and houses the impleciate objects that are created including page and any objects created on the page such as jsp beans.
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic