This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Please provide me the difference between ServletContext and ServletConfig. I know that ServletContext can be application level and ServletConfig for Servlet level. But other than that what is the difference. Your replies are always welcome.
If you read through the javadocs for the two, you'll see that they serve very different purposes. Roughly speaking, ServletContext exists one a per application, while ServletConfig exists one per servlet.
generally it's a belief that there is one servletcontext per application. but in reality
this is the case when your application is running on one jvm. if your application is running on more than one jvm's than you have more than one servletcontext objects for your application (one servlet context object per jvm).
but your servlet config object is always one per servlet/jsp.