Bug 867751 - seam-gen EAR project new-form validation doesn't work
seam-gen EAR project new-form validation doesn't work
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Seam (Show other bugs)
2.1.0
Unspecified Unspecified
unspecified Severity medium
: CR1
: 2.1.0
Assigned To: Marek Novotny
Marek Schmidt
Seam2.3
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-18 04:35 EDT by Marek Schmidt
Modified: 2012-11-30 10:35 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-30 10:35:24 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marek Schmidt 2012-10-18 04:35:41 EDT
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):

jboss-seam-2.3.0.Final-redhat-1

How reproducible:
Always

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

Actual results:
Message "myForm 12345678900 " is displayed.

Expected results:
A validation error should be displayed instead.

Additional info:
Reproducible also in the upstream Seam 2.3.0.Final
Comment 1 Marek Schmidt 2012-10-23 11:18:41 EDT
The workaround seems to be to move the annotation to the MyForm interface getValue() method.
Comment 2 Marek Novotny 2012-10-31 11:00:52 EDT
I can't reproduce it, I can see correctly 

Value* size must be between 0 and 10 

I have fill 01234567890 into input text
Comment 3 Marek Novotny 2012-10-31 12:07:49 EDT
My bad, I haven't realized that this issue is for EAR not WAR seam-gen project :(
Comment 4 Marek Novotny 2012-11-04 17:59:53 EST
fixed by moving constraint annotation to iface
Comment 5 Marek Schmidt 2012-11-05 02:48:32 EST
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).
Comment 7 Karel Piwko 2012-11-30 10:35:24 EST
Distributed as a part of WFK 2.1.0.GA release.

Note You need to log in before you can comment on or make changes to this bug.