0
votes

I am at the throes of learning RichFaces and JSF 2.X. I am using a tutorial here and Eclipse marks the faces-config declaration

<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"> 

in error

Multiple markers at this line

  • Attribute "xmlns:xsi" must be declared for element type "faces-config".
  • Attribute "xmlns" with value "http://java.sun.com/xml/ns/javaee" must have a value of "http://java.sun.com/JSF/Configuration".
  • Attribute "version" must be declared for element type "faces-config".
  • Attribute "xsi:schemaLocation" must be declared for element type "faces-config".

I know I am out of my depth here and have attempted to ascertain a fix for this. Am I missing declarations? Forget to include something?

1
It'll be easier if you will create JSF project directly in Eclipse or use maven archetypes. BTW. If you can DO NOT use RF 3.X it is deprecated from over 6 years. BTW2. Can't you tell that something is wrong if you 'are using' JSF 2.X, but adding version="1.2" to faces-config?Emil Sierżęga
Basically, it's a big difference between 1.X and 2.X and there is a difference in namespace between 2.0-1.X and 2.2.X. Your problem has anything to do with RichFaces, so if you lack of the JSF's tutorials, then read documentation on SO: stackoverflow.com/documentation/jsf/916/…. Adding RichFaces will be easy after.Emil Sierżęga

1 Answers

1
votes

For JSF 2.1, faces-config.xml should look like below -

    <?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_1.xsd"
          version="2.1">


    </faces-config>

And for JSF 2.2, faces-config.xml is changed -

        <?xml version="1.0" encoding="UTF-8"?>
        <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
            http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
            version="2.2">

       </faces-config>