Red Hat Bugzilla – Bug 867751
seam-gen EAR project new-form validation doesn't work
Last modified: 2012-11-30 10:35:24 EST
Description of problem:
The seam-gen generated form SFSB in an EAR project looks have a "value" property annotated with "@Size(max = 10)", but the validation doesn't seem to occur. The form doesn't display any validation error if a longer string is entered and the form action is executed.
A similar WAR project with a POJO instead of the SFSB generated with seam-gen seems to work fine.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Generate a new EAR project with seam-gen
2. Create a new form "seam new-form", e.g. myForm
3. build and deploy the EAR
4. go to http://127.0.0.1:8080/myearproject/myForm.seam
5. enter a string longer than 10 characters, eg. "12345678900"
6. click myForm
Message "myForm 12345678900 " is displayed.
A validation error should be displayed instead.
Reproducible also in the upstream Seam 2.3.0.Final
The workaround seems to be to move the annotation to the MyForm interface getValue() method.
I can't reproduce it, I can see correctly
Value* size must be between 0 and 10
I have fill 01234567890 into input text
My bad, I haven't realized that this issue is for EAR not WAR seam-gen project :(
fixed by moving constraint annotation to iface
I wouldn't consider moving the constraint annotation to the interface as a fix. The ability to use the constraint annotations on the implementation class is a Seam 2.2 feature, so requiring them to be used only on the interface would be a regression, which must either be fixed or documented (preferably as a known issue or in the migration guide).
Distributed as a part of WFK 2.1.0.GA release.