Tutorial 6 WebXML
You can find in this video tutorial. * What is deployment descriptor file? * How to define dispatcher servlet? * How to set URL mapping for dispatcher servlet?
It is a configuration file for web application in java. It instructs the servlet container (Tomcat) which class to load.
Things can be defined in WebXML
- Filters could be defined in it.
- Welcome file list could be defined in it.
- Error pages could be defined in it.
Some of the child elements
- Init-param: It is a static parameter, which is defined within servlet tag.It is a servlet level scope. At the servlet level you can get value of this.
- Context-param: It is a static parameter, which is defined in web.xml file. It is an application level scope parameter. If the data does not change frequently you can store in it.
- Servlet: The servlet element contains the declarative data of a servlet.
- Servlet-Mapping: The servlet-mapping element defines a mapping between a servlet and a URL pattern.
- Listener: The Listener element defines an event of the web application.