How to Configure web.xml Deployment Descriptor: Version-specific Examples

Version wise latest 5 examples of web.xml deployment descriptor. Learn how to configure web.xml easily with this guide.4 min


xml-schema web.xml file java

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,
Subscribe BeingCoders Publication on Medium. - Stay up to date with tech knowledge

adsense


Discover more from 9Mood

Subscribe to get the latest posts sent to your email.


Like it? Share with your friends!

What's Your Reaction?

Lol Lol
0
Lol
WTF WTF
0
WTF
Cute Cute
0
Cute
Love Love
1
Love
Vomit Vomit
0
Vomit
Cry Cry
0
Cry
Wow Wow
1
Wow
Fail Fail
0
Fail
Angry Angry
0
Angry
Rakshit Shah

Legend

Hey Moodies, Kem chho ? - Majama? (Yeah, You guessed Right! I am from Gujarat, India) 25, Computer Engineer, Foodie, Gamer, Coder and may be a Traveller . > If I can’t, who else will? < You can reach out me by “Rakshitshah94” on 9MOodQuoraMediumGithubInstagramsnapchattwitter, Even you can also google it to see me. I am everywhere, But I am not God. Feel free to text me.

0 Comments

Leave a Reply

Choose A Format
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Ranked List
Upvote or downvote to decide the best list item
Open List
Submit your own item and vote up for the best submission
Countdown
The Classic Internet Countdowns
Meme
Upload your own images to make custom memes
Poll
Voting to make decisions or determine opinions
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Personality quiz
Series of questions that intends to reveal something about the personality
is avocado good for breakfast? Sustainability Tips for Living Green Daily Photos Taken At Right Moment