The web.xml is a configuration file to describe how a web application should be deployed. Here’re 5 `up to date` web.xml examples version wise, just for self-reference.
Understand web modules in web xml java
Web Module Structure
In the Java EE architecture, a web module is the smallest deployable and usable unit of web resources. A web module contains web components and static web content files, such as images, which are called web resources. A Java EE web module corresponds to a web application as defined in the Java Servlet specification.
In addition to web components and web resources, a web module can contain other files:
- Server-side utility classes, such as shopping carts
- Client-side classes, such as applets and utility classes
The document root contains a subdirectory named WEB-INF, which can contain the following files and directories:
- classes: A directory that contains server-side classes: servlets, enterprise bean class files, utility classes, and JavaBeans components
- lib: A directory that contains JAR files that contain enterprise beans, and JAR archives of libraries called by server-side classes
- Deployment descriptors, such as web.xml (the web application deployment descriptor) and ejb-jar.xml (an EJB deployment descriptor)
A web module needs a web.xml
file if it uses JavaServer Faces (JSF) technology, if it must specify certain kinds of security information, or if you want to override information specified by web component annotations.
Servlet 4.0 deployment descriptor
Servlet 3.1 deployment descriptor
Java EE 7 XML schema, namespace is http://xmlns.jcp.org/xml/ns/javaee/
Servlet 3.0 deployment descriptor
Java EE 6 XML schema, namespace is http://java.sun.com/xml/ns/javaee
Servlet 2.5 deployment descriptor
Java EE 5 XML schema, namespace is http://java.sun.com/xml/ns/javaee
Servlet 2.4 deployment descriptor
J2EE 1.4 XML schema, namespace is http://java.sun.com/xml/ns/j2ee
Servlet 2.4 Web Application
Servlet 2.3 deployment descriptor
J2EE 1.3 DTDs schema. This web.xml
file is too old, highly recommend you to upgrade it.
Servlet 2.3 Web Application
Please comment your doubts if any!
You may also like,
-
How To Call a Method on Specific Time in Java?
-
JDK 21: Latest Features and Improvements You Need to Know in Java
Subscribe BeingCoders Publication on Medium. - Stay up to date with tech knowledge
Discover more from 9Mood
Subscribe to get the latest posts sent to your email.
0 Comments