Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletConfig Interface

 
Pandurangan Rakesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lot..I am clear now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic