my dog learned polymorphism*
The moose likes Servlets and the fly likes ServletConfig Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletConfig Interface" Watch "ServletConfig Interface" New topic
Author

ServletConfig Interface

Pandurangan Rakesh
Greenhorn

Joined: Jun 06, 2004
Posts: 24
Hi

What's the ServletConfig Interface used for?In init method of servlet what the Servletconfig object contains?

Thanks
Rakesh
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
The best place to learn the answer is in the JavaDocs provided in any Tomcat installation. There are also a number of good tutorials on the web, do a google search for "Java Servlet Tutorial"
Bill
Jeff Walker
Ranch Hand

Joined: Apr 25, 2004
Posts: 116
Bills right, you need to go and read about servlets.

But in a nutshell, it essentially allows you to retrieve configuration parameters from the web.xml file, for your particular servlet. (Each servlet in a web app can be initialized differently). Hence the name, "Servlet Configuration" shortened to ServletConfig.

As opposed to the ServletContext interface, which really represents the servlet container to any servlet in the web app. The object that implements the ServletContext will be the same for all servlets within a web app, and so all servlets can get a copy of it and it will be the same for all of them.

I would recommend "SCWCD Exam Study Guide" by Deshmukh and Malavia. It's a classic now for studying for the SCWCD exam, but it's very useful for general brushing up on servlets and JSPs.

Jeff Walker
Pandurangan Rakesh
Greenhorn

Joined: Jun 06, 2004
Posts: 24
Thanks Lot..I am clear now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletConfig Interface