This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

explanation in Jwebplus

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic