Question : what does a web.xml do

Hi,

What is the use of web.xml while creating a war file in ant script ?
Code Snippet:
1:
2:
3:
4:
5:

        
        
        
      

Answer : what does a web.xml do

web.xml is used for getting the deployment configuration, initial servlet parameters, filters and so on.

Without this, the servlet container has no ways of understanding what to do with the servlet. For instance, if you dont give the proper servlet-mapping in web.xml you might get error. Servlet container reads the web.xml from the war and understands what to do with the servlet.
Random Solutions  
 
programming4us programming4us