1
votes

I use JSF for my project and I define a converter in faces-config.xml like bellow:

<converter>
  <description>myDateTimeConverter</description>
  <display-name>myDateTimeConverter</display-name>
  <converter-id>myDateTimeConverter</converter-id>
  <converter-for-class>java.util.Date</converter-for-class>
  <converter-class>controller.MyDateTimeConverter</converter-class>  
 </converter>

And I get an error in (in eclipse):

cvc-complex-type.2.4.a: Invalid content was found starting with element 'converter-for-class'. One of '{"http://java.sun.com/xml/ns/javaee":converter-class}' is 
 expected.
1
I copy this code from a tutorial. Then I don't think it have wrong in syntaxDuong Nhat

1 Answers

0
votes

Either use converter-id or either use converter-class. If you use id then JSF expects converter-class after it. That's why it says 'One of '{"http://java.sun.com/xml/ns/javaee":converter-class}' is expected.'. If you copied this from a tutorial, the tutorial contains an error ;-).