Title: [waffle-scm] [433] trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple: Tidying up simple example validation so that the behaviour is the same as when using the validator.
Revision
433
Author
mauro
Date
2007-11-25 17:29:37 -0600 (Sun, 25 Nov 2007)

Log Message

Tidying up simple example validation so that the behaviour is the same as when using the validator.

Modified Paths

Diff

Modified: trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple/AutomobileController.java (432 => 433)

--- trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple/AutomobileController.java	2007-11-25 17:32:48 UTC (rev 432)
+++ trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple/AutomobileController.java	2007-11-25 23:29:37 UTC (rev 433)
@@ -51,7 +51,7 @@
     }
 
     public void accelerate(ErrorsContext errorsContext, int value) {
-        if(speed > topSpeed) {
+        if(speed + value > topSpeed) {
             String message = "Speed cannot exceed top speed: "+topSpeed;
             errorsContext.addErrorMessage(new FieldErrorMessage("speed", "" + speed, message));
         }

Modified: trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple/SimpleRegistrar.java (432 => 433)

--- trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple/SimpleRegistrar.java	2007-11-25 17:32:48 UTC (rev 432)
+++ trunk/examples/simple-example/src/main/java/org/codehaus/waffle/example/simple/SimpleRegistrar.java	2007-11-25 23:29:37 UTC (rev 433)
@@ -24,6 +24,8 @@
     public void session() {
         register("calculator", CalculatorController.class);
         register("automobile", AutomobileController.class);
+        //validation for automobile controller done in the controller itself
+        //uncomment registration of validator if you prefer to override it
         //register("automobileValidator", AutomobileControllerValidator.class);
         register("person", PersonController.class);
     }


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to