Differentiation between servletcontext and pagecontext?
Hello Friends,
I am beginner to the Java programming. Currently I am studying JSP from advanced java programming. I want know about the two objects of JSP i.e pagecontext and servletcontext. I don't know what is the difference between pagecontext and servletcontext objects of JSP. If you have knowledge about this two object then please let me know diferentiation between them. I am waiting for your reply.
Re: Differentiation between servletcontext and pagecontext?
A PageContext object in JSP offers access to all the namespaces which are associated to the JSP page. ServletContext represents the context in which the servlet runs, this context is common to all servlets and contains information common to the application. The PageContext provides a number of facilities to the page/component author and page implementor. Servlet context defines a set of JSP methods which a servlet uses to communicate with its servlet container for example to get the MIME type of a file dispatch requests or write to a log file. Implicit objects are added to the pageContext automatically. A PageContext instance provides access to all the namespaces associated with a JSP page
Re: Differentiation between servletcontext and pagecontext?
There is only one servletcontext for a web application where as there is only one pagecontext for a page. PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment. ServletContext gives the information about the containerservlet context is an interface whereas pagecontext is an abstract class.PageContext gives the information about the Request
Re: Differentiation between servletcontext and pagecontext?
PageContext object if JSP offers following facilities:
* Managing the session usage by the page.
* Handling of errorpage exception processing.
* Managing the various scoped namespaces.
* Managing active components of the application.
Re: Differentiation between servletcontext and pagecontext?
Hi,
'static String' is used to store ServletContext in PageContext name table. PageContext is used for to holds the attributes as Objects like key & value pairs in JSP. For whole web application there will be one ServletContext object. PageContext instance provides access to all the namespaces associated with a JSP page provides access to several page attributes as well as a layer above the implementation details.
Re: Differentiation between servletcontext and pagecontext?
Hi friend,
The PageContext gives the servlet (or JSP) information about the request that it is currently handling and contains information about the request and any parameters, the session, the response object, a reference to the output stream and also a reference to the web application's servletContext. Reference of 'static int' remains in the ServletContext until it is reclaimed.pagecontext is used for urlrequesting and servlecontext is used for particularServlet