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/02 13:50:02 UTC
svn commit: r831883 - in
/myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank:
HelloWorldController.java domain/Person.java
Author: gpetracek
Date: Mon Nov 2 12:50:02 2009
New Revision: 831883
URL: http://svn.apache.org/viewvc?rev=831883&view=rev
Log:
example update
Modified:
myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/HelloWorldController.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java
Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/HelloWorldController.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/HelloWorldController.java?rev=831883&r1=831882&r2=831883&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/HelloWorldController.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/HelloWorldController.java Mon Nov 2 12:50:02 2009
@@ -29,10 +29,14 @@
* A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
*/
-//in case of deactivated default validation
-@BeanValidation
+//adds the default group on form1 in case of group validation* for properties which contain this bean in the path
+//in this case every value binding which starts with helloWorld e.g. #{helloWorld.person.firstName}
+//*in this example the User group is used
+@BeanValidation(viewIds = "/form1.jsp")
public class HelloWorldController
{
+ //adds the default group on form1 in case of group validation for properties which contain this property in the path
+ //in this case every value binding which starts with helloWorld.person e.g. #{helloWorld.person.firstName}
//@BeanValidation(viewIds = "/form1.jsp")
private Person person = new Person();
@@ -43,9 +47,6 @@
{
}
- /**
- * Method that is backed to a submit button of a form.
- */
public String send()
{
//do real logic, return a string which will be used for the navigation system of JSF
@@ -53,7 +54,6 @@
}
@BeanValidation.List({
- @BeanValidation(viewIds = "/helloWorld.jsp"),
@BeanValidation(viewIds = "/form1.jsp", useGroups = User.class),
@BeanValidation(viewIds = "/form2.jsp", useGroups = Admin.class),
@BeanValidation(viewIds = "/violation.jsp", useGroups = Admin.class),
Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java?rev=831883&r1=831882&r2=831883&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/examples/hello_bean-validation/src/main/java/org/apache/myfaces/blank/domain/Person.java Mon Nov 2 12:50:02 2009
@@ -21,15 +21,12 @@
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.baseval.annotation.Required;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
public class Person
{
- //hello world demo
- @Required
private String firstName;
//demo for bean validation based validation support