Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet context,page context and application context

 
bhavya donepudi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between servlet context,page context and application context?
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhavya donepudi wrote:What is the difference between servlet context,page context and application context?


Please SearchFirst.(⇐click) There's plenty of information readily available for "what is X" questions, and probably plenty available if you just paste that exact question into a google search.
 
john wutka
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The pageContext object represents the environment for the page, containing useful information like page attributes, access to the request, response and session objects, as well as the JspWriter referenced by out. This object also has methods for including another URL's contents, and for forwarding or redirecting to another URL. For example, to forward a request to another resource from in a JSP page, we can do that by using the pageContext variable:

pageContext.forward ("other.jsp");

Here are interesting links

http://www.jguru.com/faq/view.jsp?EID=56477

http://grails.1312388.n4.nabble.com/Difference-between-Application-and-Servlet-contexts-td1322054.html

 
harsh kurra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhavya donepudi wrote:What is the difference between servlet context,page context and application context?


serveletcontext is javax.servlet.ServletContext class provide your server and it is available as 'application ' implicit object in jsp
usage=same as we use it in servelt

pagecontext is javax.servlet.jsp.PageContext and it is available as 'pagecontext' implicit object in jsp
usage=it has getattribute(),setattribute() method to bind the object to current page like Httpserveltcontext and it also have forward and include method
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic