[seam-commits] Seam SVN: r13275 - examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sat Jun 19 18:56:06 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-06-19 18:56:06 -0400 (Sat, 19 Jun 2010)
New Revision: 13275

Modified:
   examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java
Log:
Instance is not needed

Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java	2010-06-19 22:54:53 UTC (rev 13274)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java	2010-06-19 22:56:06 UTC (rev 13275)
@@ -21,7 +21,6 @@
  */
 package org.jboss.seam.examples.booking.account;
 
-import javax.enterprise.inject.Instance;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -35,13 +34,16 @@
 import org.jboss.seam.international.status.builder.BundleTemplateMessage;
 
 /**
+ * Validate that both the password fields contain the same value. Implements the
+ * classic pasword change validation.
+ * 
  * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
  */
 @FacesValidator("confirmPassword")
 public class ConfirmPasswordValidator implements Validator
 {
    @Inject
-   private Instance<BundleTemplateMessage> messageBuilder;
+   private BundleTemplateMessage messageBuilder;
 
    @Inject
    @InputField
@@ -53,15 +55,9 @@
 
    public void validate(final FacesContext ctx, final UIComponent form, final Object components) throws ValidatorException
    {
-      //Map<String, UIInput> fieldMap = (Map<String, UIInput>) components;
       if ((newPassword != null) && !newPassword.equals(confirmPassword))
       {
-         throw new ValidatorException(
-            new FacesMessage(messageBuilder.get().text(
-               new DefaultBundleKey("account_passwordsDoNotMatch"))
-                  // targets not honored yet
-                  //.targets(fieldMap.get("confirmPassword").getClientId())
-                  .build().getText()));
+         throw new ValidatorException(new FacesMessage(messageBuilder.text(new DefaultBundleKey("account_passwordsDoNotMatch")).build().getText()));
       }
    }
 



More information about the seam-commits mailing list