Results 1 to 6 of 6

Thread: Differentiation between servletcontext and pagecontext?

  1. #1
    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.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    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

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    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

Similar Threads

  1. Differentiation between XML and PHP
    By Gokul20 in forum Software Development
    Replies: 5
    Last Post: 10-03-2010, 03:43 PM
  2. Differentiation between XML and Html
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 12-02-2010, 12:27 PM
  3. Differentiation between servletConfig and servletContext
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 05-02-2010, 08:57 AM
  4. Differentiation between WAN and LAN
    By Dolsy_bendal in forum Networking & Security
    Replies: 4
    Last Post: 30-11-2009, 10:46 AM
  5. Want to implement differentiation in C++
    By ADEN in forum Software Development
    Replies: 1
    Last Post: 25-10-2008, 06:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,534,987.69921 seconds with 17 queries