Thursday, October 7, 2010

ServletConfig:

ServletConfig:
Package -javax.servlet
Interface/Class-interface
Total Method :4
1-java.lang.String getServletName() { }
  This method is return the name of the servlet.
2-javax.servlet.ServletContext getServletContext() { }
  This is return the Object of ServletContext
3-java.lang.String getInitParameter(java.lang.String p1) { }
  if you but any parameter in web.xml then using this method you retrive the value
4-java.util.Enumeration getInitParameterNames() { }

ServletConfig :it is one par servlet.When the container intitalize a servlet .it create a unique servletConfig for the servlet .

Example:How to put any value in the web.xml
Because the servletConfig is one par servlet so  the param value and param name tag should be with in servlet tag.

<init-param>
<init-name>
</init-name>
<init-value>
</init-value>