From e25742269b7dddadbdf4bddb2fa25011c1fd4594 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Apr 2017 10:45:37 +0200 Subject: [PATCH] Injection is not working in converters/validators as JavaEE is not so super-flexible ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../password/AddressbookUserPasswordValidator.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java b/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java index 0877ce88..133d643a 100644 --- a/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java +++ b/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java @@ -16,18 +16,13 @@ */ package org.mxchange.addressbook.validator.password; -import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import javax.inject.Inject; -import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController; import org.mxchange.jcoreee.validator.string.BaseStringValidator; -import org.mxchange.jusercore.container.login.LoginContainer; -import org.mxchange.jusercore.container.login.UserLoginContainer; -import org.mxchange.jusercore.model.user.UserUtils; /** * A validator for validating passwords (if they match with stored) @@ -42,12 +37,6 @@ public class AddressbookUserPasswordValidator extends BaseStringValidator implem */ private static final long serialVersionUID = 48_581_795_687_317L; - /** - * User login controller - */ - @Inject - private AddressbookUserLoginWebSessionController userLoginController; - @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // Trace message @@ -59,6 +48,8 @@ public class AddressbookUserPasswordValidator extends BaseStringValidator implem // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); + /* + * @TODO injection is not working in converters. No, JavaEE is not so super-flexible. // value is known to be an entered password, so instance login container LoginContainer container = new UserLoginContainer(this.userLoginController.getLoggedInUser(), (String) value); @@ -67,6 +58,7 @@ public class AddressbookUserPasswordValidator extends BaseStringValidator implem // Password mismatches throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N } + */ // Trace message //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N -- 2.39.5