You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gp...@apache.org on 2009/11/05 17:00:35 UTC

svn commit: r833065 - in /myfaces/extensions/validator/trunk/examples: hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/ hello_bean-validation/src/main/webapp/ hello_world/src/main/java/org/apache/myfaces/blank/domain/ hello_world/sr...

Author: gpetracek
Date: Thu Nov  5 16:00:02 2009
New Revision: 833065

URL: http://svn.apache.org/viewvc?rev=833065&view=rev
Log:
updated examples

Modified:
    myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java
    myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/webapp/helloWorld.jsp
    myfaces/extensions/validator/trunk/examples/hello_world/src/main/java/org/apache/myfaces/blank/domain/Person.java
    myfaces/extensions/validator/trunk/examples/hello_world/src/main/webapp/helloWorld.jsp

Modified: myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java?rev=833065&r1=833064&r2=833065&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java (original)
+++ myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java Thu Nov  5 16:00:02 2009
@@ -21,12 +21,14 @@
 import org.apache.myfaces.blank.validation.group.Admin;
 import org.apache.myfaces.blank.validation.group.User;
 import org.apache.myfaces.blank.validation.group.Address;
+import org.apache.myfaces.extensions.validator.beanval.payload.ViolationSeverity;
 
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 
 public class Person
 {
+    @NotNull(payload = ViolationSeverity.Warn.class)
     private String firstName;
 
     //demo for bean validation based validation support

Modified: myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/webapp/helloWorld.jsp
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/webapp/helloWorld.jsp?rev=833065&r1=833064&r2=833065&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/webapp/helloWorld.jsp (original)
+++ myfaces/extensions/validator/trunk/examples/hello_bean-validation/src/main/webapp/helloWorld.jsp Thu Nov  5 16:00:02 2009
@@ -25,13 +25,13 @@
         <f:view>
             <h:form id="mainForm">
               <h:panelGrid columns="3">
-                <h:outputLabel for="first_name" value="First name:"/>
+                <h:outputLabel for="first_name" value="First name*:"/>
                 <h:inputText id="first_name" label="First name" value="#{helloWorld.person.firstName}"/>
-                <h:message for="first_name" showSummary="true" showDetail="false"/>
+                <h:message for="first_name" showSummary="false" showDetail="true" errorStyle="color: red;" warnStyle="color: orange;"/>
 
-                <h:outputLabel for="last_name" value="Last name:"/>
+                <h:outputLabel for="last_name" value="Last name**:"/>
                 <h:inputText id="last_name" label="Last name" value="#{helloWorld.person.lastName}"/>
-                <h:message for="last_name" showSummary="true" showDetail="false"/>
+                <h:message for="last_name" showSummary="false" showDetail="true" errorStyle="color: red;" warnStyle="color: orange;"/>
 
                 <h:commandButton value="Press me" action="#{helloWorld.send}"/>
                 <h:panelGroup/>
@@ -39,5 +39,8 @@
               </h:panelGrid>
             </h:form>
         </f:view>
+        <hr/>
+        * none blocking warn mode<br/>
+        ** blocking error mode
     </body>
 </html>

Modified: myfaces/extensions/validator/trunk/examples/hello_world/src/main/java/org/apache/myfaces/blank/domain/Person.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/examples/hello_world/src/main/java/org/apache/myfaces/blank/domain/Person.java?rev=833065&r1=833064&r2=833065&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/examples/hello_world/src/main/java/org/apache/myfaces/blank/domain/Person.java (original)
+++ myfaces/extensions/validator/trunk/examples/hello_world/src/main/java/org/apache/myfaces/blank/domain/Person.java Thu Nov  5 16:00:02 2009
@@ -19,13 +19,14 @@
 package org.apache.myfaces.blank.domain;
 
 import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+import org.apache.myfaces.extensions.validator.core.validation.parameter.ViolationSeverity;
 
 import javax.persistence.Column;
 
 public class Person
 {
     //hello world demo
-    @Required
+    @Required(parameters = ViolationSeverity.Warn.class)
     private String firstName;
 
     //demo for jpa based validation support

Modified: myfaces/extensions/validator/trunk/examples/hello_world/src/main/webapp/helloWorld.jsp
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/examples/hello_world/src/main/webapp/helloWorld.jsp?rev=833065&r1=833064&r2=833065&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/examples/hello_world/src/main/webapp/helloWorld.jsp (original)
+++ myfaces/extensions/validator/trunk/examples/hello_world/src/main/webapp/helloWorld.jsp Thu Nov  5 16:00:02 2009
@@ -25,13 +25,13 @@
         <f:view>
             <h:form id="mainForm">
               <h:panelGrid columns="3">
-                <h:outputLabel for="first_name" value="First name:"/>
+                <h:outputLabel for="first_name" value="First name*:"/>
                 <h:inputText id="first_name" label="First name" value="#{helloWorld.person.firstName}"/>
-                <h:message for="first_name" showSummary="true" showDetail="false"/>
+                <h:message for="first_name" showSummary="false" showDetail="true" errorStyle="color: red;" warnStyle="color: orange;"/>
 
-                <h:outputLabel for="last_name" value="Last name:"/>
+                <h:outputLabel for="last_name" value="Last name**:"/>
                 <h:inputText id="last_name" label="Last name" value="#{helloWorld.person.lastName}"/>
-                <h:message for="last_name" showSummary="true" showDetail="false"/>
+                <h:message for="last_name" showSummary="false" showDetail="true" errorStyle="color: red;" warnStyle="color: orange;"/>
 
                 <h:commandButton value="Press me" action="#{helloWorld.send}"/>
                 <h:panelGroup/>
@@ -39,5 +39,8 @@
               </h:panelGrid>
             </h:form>
         </f:view>
+        <hr/>
+        * none blocking warn mode<br/>
+        ** blocking error mode
     </body>
 </html>