• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference Betn. ServletContext and ServletConfig!!

 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Folks,
I would like to know the difference between the Servlet Context and Servlet Config.
Regards,
Ravi
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ServletContext is the over all web application. These include the the parameters you list in the web.xml in the context-param element. (outside any servlet elements you specify) There is a single copy for any and all servlets and jsps running in the web application. Additionally, any Attribute you add to the ServletContext is available to them all and there is one and only one.
ServletConfig is the configuration for a single Servlet or JSP. These include the init-param you list within the servlet element of the web.xml. ServletConfig doesn't have the ability to set or get Attributes.
 
reply
    Bookmark Topic Watch Topic
  • New Topic