• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is ServletConfig whats its role in Servlets?

 
Rakesh Mehra
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is ServletConfig.what role does super.init(config)play?.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Logg_Man",
Please check your private messages
 
mithun gooty
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletConfig is an interface under javax.servlet package. This interface represents a servlet configuration object that passes information from the servlet container to a servlet during the servlet initialization.
 
mithun gooty
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ServletConfig object is used elsewhere in the servlet, and the init method of the superclass registers it where the servlet can find it later. So, you can cause yourself huge headaches later if you omit the super.init call.
 
Hanuma Deepak Muvvala
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some other uses of ServletConfig are you can have init parameters for each servlet and can get the parameters using servlet config object, you can access the servlet context object by using servlet config object. one more point our Generic Servlet implements the ServletConfig interface.

Thanks,
Deepak .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic