Watch “Servlet Part-8 (Servlet Context and Servlet Config parameter)” on YouTube

Servlet Context parameters are application wide parameter (such as global variables) accessible through out web application, any servlet or Jsp page can access these parameters, and there is only one copy of such parameters per web app.

These parameters are to be configured in web.xml file in java web application.

Servlet config parameters are specific to the servlet for which is declared, it is local for that servlet. These parameters are private to each servlet. These parameters are also configured in web.xml (inside servlet tag).

OS : Windows 10
Jdk : Version 8
IDE : Eclipse Mars
Server : Apache Tomcat 7

follow me @
https://raviroza.wordpress.com/
https://twitter.com/raviozaIT
https://www.facebook.com/ravi.oza.it

Subscribe my channel to get latest video notification https://www.youtube.com/user/ravioza101

Servlet Part-7 (Servlet Mapping with Deployment Descriptor/web.xml file)

Deployment descriptor file which is also known as web.xml file, is used to configure the web app as well as servlet.

It is most important while the web app is to be deployed on the server, for example the database connection is going to differ while you deploy the app on server, so its preferable to define such settings in web.xml file because its a tag file which can be easily editable in any editor.

If we define the such settings in java file they need to be edited and re-compile on server, which is not feasible.

OS : Windows 10
Jdk : Version 8
IDE : Eclipse Mars
Server : Apache Tomcat 7

follow me @
https://raviroza.wordpress.com/
https://twitter.com/raviozaIT
https://www.facebook.com/ravi.oza.it

Subscribe my channel to get latest video notification https://www.youtube.com/user/ravioza101