Which DTD should I use in JSF 1.2 / 2.0 / 2.1 to validate my XML configuration?

I currently have a DTD:

<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> 

And it does not check 1.2 tags, for example:

 managed-bean => managed-property 

And I can not find a newer version of the sun form: http://java.sun.com/dtd/

from some tutorials, I see that people just don’t use DTD for JSF 2 at all, should I try to find a DTD or DTD deprecated for JSF 1.2 +?

Thanks so much for your suggestions.

+6
source share
1 answer

JSF 2.0 does not have a DTD. This is XSD.

 <?xml version="1.0" encoding="UTF-8"?> <faces-config 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-facesconfig_2_0.xsd" version="2.0" > <!-- Config here --> </faces-config> 

The same applies to JSF 1.2.

 <?xml version="1.0" encoding="UTF-8"?> <faces-config 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-facesconfig_1_2.xsd" version="1.2" > <!-- Config here --> </faces-config> 

If you use JSF 1.1 DTD on JSF 1.2 / 2.0, then these applications will work in JSF 1.1 mode. You really do not want this.

+11
source

Source: https://habr.com/ru/post/889111/


All Articles