[jboss-user] [JBoss Seam] - Re: My list of questions: Seam validation, transactions and

petemuir do-not-reply at jboss.com
Sun Jun 10 13:50:23 EDT 2007


Ok, lets see the backing bean as well :)

You are using a form of JSF validation (#{spaceManager.validateSpaceName}), but you aren't using what Gavin is calling JSF (I would perhaps call it Seam/Hibernate/JSF validation ;) ) - Seam/JSF/Hibernate validation is using a combination of @Min, @Max etc. and s:validate/s:validateAll.  This is the simplest and most powerful validation available in Seam IMO.

anonymous wrote : Do I still need <s:validateAll/> in this case? 

No.

Doing validation in action methods (in your case #{spaceManager.updateInstance}) is fine, but, it certainly isn't done in the JSF validation phase, so, your model *will* have been updated with invalid data.  It's your responsibility as the developer to deal with this (using @Rollback is, IIRC, one way of doing this, another is to be in flushmode=MANUAL and reload the data manually).  This is CERTAINLY NOT the recommended way of doing simple validation (but is required for more complicated situations, like when you need to compare values).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052933#4052933

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052933



More information about the jboss-user mailing list