You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 12 Members of 9401 |
| Forum: Seam Users |
13. Oct 2008, 18:21 America/New_York | Link |
Create a Seam project using Jboss Tools 2.1.2.
Create a new Seam Form with name SeamDateForm
Open the file SeamDateForm.java and change the value from Integer to java.util.Date.
Right-click seamDateForm.xhtml and click Run As... -> Run On Server.
Write something in the form (like for example some random string dfasdf
)
You will get the error: Conversion Error setting value 'dfasdf' for 'null Converter'.
Now create a Date Converter, as the one included in the attached test case project (BTW it inherits from javax.faces.convert.DateTimeConverter).
Stop the application (just to be 100% sure everything gets loaded correctly)
Again:
Right-click seamDateForm.xhtml and click Run As... -> Run On Server.
Write something in the form (like for example some random string dfasdf
)
Now you get the right error: value must be a date, eg. 10/13/2008.
Of course it not only fails when you write a random string, even if you write a correct date, like 01/01/2001, you will get an error that says: Conversion Error setting value '01/01/2001' for 'null Converter'. But if you write your own converter (for example inheriting from javax.faces.convert.DateTimeConverter) everything works fine.
I think that if Seam uses automatically and transparently, javax.faces.convert.IntegerConverter, or javax.faces.convert.LongConverter, it should do the same with javax.faces.convert.DateTimeConverter, I shouldn't need to create or configure my own converter. Therefore JBSEAM-3551 is created
Please don't forget to rate!
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. - Antoine de Saint Exupéry
Please visit my blog