aspose file tools*
The moose likes Servlets and the fly likes Why is servletConfig object is so special Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why is servletConfig object is so special" Watch "Why is servletConfig object is so special" New topic
Author

Why is servletConfig object is so special

Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

I want to know why is servlet-config is so special apart from you can initialize parameter and retrieve it .
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42931
    
  68
Who says it's special? Special in which way?
Dieter Quickfend
Bartender

Joined: Aug 06, 2010
Posts: 543
    
    4

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.


Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Mahesh Panchananam
Greenhorn

Joined: Jun 30, 2011
Posts: 18
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

Joined: Sep 30, 2010
Posts: 290

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

Joined: Sep 30, 2010
Posts: 290

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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why is servletConfig object is so special