Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Differentiation between servletcontext and pagecontext?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-01-2010
Member
 
Join Date: Dec 2009
Posts: 32
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.

Reply With Quote
  #2  
Old 28-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,944
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
Reply With Quote
  #3  
Old 28-01-2010
Member
 
Join Date: May 2008
Posts: 2,001
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
Reply With Quote
  #4  
Old 28-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,993
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.
Reply With Quote
  #5  
Old 28-01-2010
Member
 
Join Date: May 2008
Posts: 2,283
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.
Reply With Quote
  #6  
Old 28-01-2010
Member
 
Join Date: Oct 2005
Posts: 2,385
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Differentiation between servletcontext and pagecontext?"
Thread Thread Starter Forum Replies Last Post
Differentiation between XML and PHP Gokul20 Software Development 5 10-03-2010 02:43 PM
Differentiation between XML and Html Sarfaraj Khan Software Development 5 12-02-2010 11:27 AM
Differentiation between servletConfig and servletContext Sonam Goenka Software Development 5 05-02-2010 07:57 AM
Differentiation between WAN and LAN Dolsy_bendal Networking & Security 4 30-11-2009 09:46 AM
Want to implement differentiation in C++ ADEN Software Development 1 25-10-2008 06:13 PM


All times are GMT +5.5. The time now is 05:36 AM.