• Post Reply Bookmark Topic Watch Topic
  • New Topic

pageContext .include("somefile")  RSS feed

 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when we say : pageContext.include("somefile") in any normal JSP file, is this statement equivalent to include method of ServletContext, or of <jsp:include>, pls explain...
One more query : what does PageContext represent ? Whats its use ? why PageContext instance is automatically availablein JSp pages ?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,

What happens when we say : pageContext.include("somefile") in any normal JSP file, is this statement equivalent to include method of ServletContext, or of <jsp:include>, pls explain...
-> It is equivalent to <jsp:include page="somefile">. Besides, does not exist a method named include in ServletContext interface...
One more query : what does PageContext represent ? Whats its use ? why PageContext instance is automatically availablein JSp pages ?
-> PageContext is an implicit object that let us access all other implicit objects proggramatically. It is generally used in the development of custom tag libraries.
Regards,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!