• Post Reply Bookmark Topic Watch Topic
  • New Topic

explanation in Jwebplus  RSS feed

 
Ernest Lee
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??

 
Carl Trusiak
Sheriff
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!