• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

different headers JSF 1.1 and JSF 2.0

 
Christin Vogt
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello together,

i work with jsf since 4 weeks. i started with JSF 1.1 and now i want to migrate my project to JSF 2.0.
i know that i have to change the header

header JSF 2.o:
<?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"
version="2.5">

header JSF 1.1
<?xml version="1.0" encoding="UTF-8"?>
<!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 id="WebApp_ID">

can someone explain me the different headers? i want to understand why i have to change them.

thank you!

greetz from germany
 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

The main reason is that you move to using a new Java Servlet Specification. Old was 2.3 and the new is 2.5.

More background info for example from here
http://en.wikipedia.org/wiki/Java_Servlet

And you can naturally find the specifications from Oracle web site.

EDIT: Oh, and if you were wondering why the old was defined with dtd and the new one with xsd please read these
http://en.wikipedia.org/wiki/Document_Type_Definition
http://en.wikipedia.org/wiki/XML_Schema_%28W3C%29
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't a header, it's a schema reference. The schema reference points to a schema definition so that XML processors can automatically validate the XML.

The big difference here is that you're moving from a DTD to an XML schema (sometimes known as "xsd"). DTD's are the older of the 2 schema definition types and they are more limited, so newer specs use xsd's instead.

Whether you use a DTD or a schema, you do need to use the version that matches the XML content you're defining. Otherwise the XML parser will completely reject your XML without passing it on to the code that actually employs the XML.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic