ProAnswers.org

What is the difference between Context init parameter and Servlet init parameter?

Servlet init parameters are for a single servlet only. No body out side that servlet can access that. Itis declared inside the tag inside Deployment Descriptor, where as context init parameter is for the entire web application. Any servlet or JSP in that web application can access context init parameter. Context parameters are declared in a tag directly inside the tag. The methods for accessing context init parameter is getServletContext ().getInitParamter (“name”) where as method for accessing servlet init parameter is getServletConfig ().getInitParamter (“name”);