Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

Servlet Config and Servlet Context

 
Vigneswaran Marimuthu
Greenhorn
Posts: 24
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Report post to moderator
hello all,

I need to know what will be present inside servlet config and servlet context ? I need a bit brief explanation. Any help will be appreciated. Thanks in advance !!!
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am not sure of what you are asking.
I guess this can help:

A ServletConfig is "A servlet configuration object used by a servlet container to pass information to a servlet during initialization." ServelConfig can be used to get servlet specific initialization parameters configured in Deployment Descriptor.

A ServletContext: "Defines a set of methods that 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. There is one context per "web application" per Java Virtual Machine."
All servlets have access to one servlet context which also can have init parameters. Also you can set attributes which can be an Object, in a servlet context, but not in a servlet config.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please check the JavaDoc for questions such as these.
 
    Bookmark Topic Watch Topic
  • New Topic