From: andrew.rw.robinson <do-...@jb...> - 2006-02-25 22:51:39
|
I would be great if the "ifInvalid" interceptor annotation could take a severity so that it would not default to FacesMessage.INFO. I would rather have hibernate validation issues as error. Here is a patch to IfInvalid.java: Index: IfInvalid.java | =================================================================== | RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/annotations/IfInvalid.java,v | retrieving revision 1.6 | diff -r1.6 IfInvalid.java | 10a11,12 | > import javax.faces.application.FacesMessage; | > | 36a39,43 | > * The string value of the {@link FacesMessage.Severity FacesMessage.Severity} value. | > * Defaults to "Info". | > */ | > String severity() default "Info"; | > /** | Here is a patch to ValidationInterceptor: =================================================================== | RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/ValidationInterceptor.java,v | retrieving revision 1.10 | diff -r1.10 ValidationInterceptor.java | 58c58 | < addMessageToFacesContext(iv); | --- | > addMessageToFacesContext(iv, ifInvalid.severity()); | 89c89 | < private void addMessageToFacesContext(InvalidValue iv) | --- | > private void addMessageToFacesContext(InvalidValue iv, String severity) | 94c94,97 | < facesContext.addMessage( clientId, new FacesMessage( iv.getMessage() ) ); | --- | > FacesMessage msg = new FacesMessage(); | > msg.setSummary(iv.getMessage()); | > msg.setSeverity((FacesMessage.Severity)FacesMessage.VALUES_MAP.get(severity)); | > facesContext.addMessage( clientId, msg ); | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3926309#3926309 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3926309 |