Posts Tagged ‘web.xml

28
Nov
09

Web Application Deployment Descriptors web.xml

This page is about how the web.xml header should look like for various versions of Java Enterprise Applications.

The following URL contains information about deployment descriptors for the Java Enterprise Applications.

web.xml for a Java EE 6 application

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee                       http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

     <display-name>Sample Web Application</display-name>
</web-app>

Java EE 5 application

http://java.sun.com/xml/ns/javaee/index.html

The following is for the Servlet 2.5 / JSP 2.1

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Sample Web Application</display-name>
</web-app>

For J2EE 1.4

http://java.sun.com/xml/ns/j2ee/

Enhancements

  • Built in support for JSTL
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

    <display-name>Sample Web Application</display-name>
</web-app>

For J2EE 1.3

http://java.sun.com/dtd/

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
<display-name>Sample Web Application</display-name>
</web-app>
This site is a collaborative effort! The complete text and sourcecode for this is available on GitHub. Corrections and enhancements are welcome, please make the change and submit a pull request in the comment area below.
Advertisements



Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 77 other followers

September 2017
S M T W T F S
« Mar    
 12
3456789
10111213141516
17181920212223
24252627282930

Blog Stats

  • 830,680 hits