aspose file tools*
The moose likes Servlets and the fly likes web.xml header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "web.xml header" Watch "web.xml header" New topic
Author

web.xml header

Ken Duncan
Ranch Hand

Joined: Apr 30, 2007
Posts: 39

I am working on a web application to learn Spring. In viewing what I'm supposed to see in the web.xml file, it looks different than I think it should be:

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.4"
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" >


A proper web.xml file should start this way I believe:
<web-app version="2.4"
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">

Neither of these match what IDEA 9.0.2 built for me:
<!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>

These three things cannot all be right, so how do I know which one is correct? Thanks.

Ken

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Your first two differ only by the optional XML header.

The 3rd variant is for Servlets 2.3.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web.xml header
 
Similar Threads
doubt in EL
param in jsp forward
some (simple) question on DTD
struts 1.3.5 : EL not evaluated anymore
JSP EL not working