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

Why is servletConfig object is so special

 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know why is servlet-config is so special apart from you can initialize parameter and retrieve it .
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who says it's special? Special in which way?
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it has a +4 magic sword with protection from all elements which it can also use to summon elves, of course. Without the sword, it would be just a regular object. Like a servlet without the servlet hat.
 
Mahesh Panchananam
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletConfig is the main interface in the web applications because any servlet that you create will be extending GenericServlet ultimately & which inturn will implement the ServletConfig interface.

It's required to pass the information while initialization of any servlet.




Rgds
Mahesh PS
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mahesh Panchananam wrote:ServletConfig is the main interface in the web applications because any servlet that you create will be extending GenericServlet ultimately & which inturn will implement the ServletConfig interface.

It's required to pass the information while initialization of any servlet.




Rgds
Mahesh PS


I mean i'm not going to pass any information to be initialized for my servlet ,so what's going to initialized as a default .
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Who says it's special? Special in which way?

Than why the spec give init(ServletConfig) method .
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what the problem is but anyway:

ServletConfig is the interface for one of the many objects created and controlled by the servlet container.

To quote the JavaDocs, it is used to "pass information to a servlet during initialization."

This is information any web application MUST HAVE in order to function in the servlet container environment.

The servlet API is your best source for this sort of explanation.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic