From: Roland Häder Date: Thu, 20 Apr 2017 08:45:37 +0000 (+0200) Subject: Injection is not working in converters/validators as JavaEE is not so super-flexible ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b98c7e03bc73facbaeda727f9e27315c1af50f6;p=pizzaservice-war.git Injection is not working in converters/validators as JavaEE is not so super-flexible ... Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java b/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java index e778ebb0..7424f8d8 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java @@ -28,7 +28,7 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator; *

* @author Roland Häder */ -@FacesValidator (value = "NameValidator") +@FacesValidator ("NameValidator") public class PizzaNameValidator extends BaseStringValidator implements Validator { /** diff --git a/src/java/org/mxchange/pizzaapplication/validator/number/item_amount/PizzaItemAmountValidator.java b/src/java/org/mxchange/pizzaapplication/validator/number/item_amount/PizzaItemAmountValidator.java index dfe3266f..fb857584 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/number/item_amount/PizzaItemAmountValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/number/item_amount/PizzaItemAmountValidator.java @@ -28,7 +28,7 @@ import org.mxchange.jcoreee.validator.number.BaseLongValidator; *

* @author Roland Häder */ -@FacesValidator (value = "ItemAmountValidator") +@FacesValidator ("ItemAmountValidator") public class PizzaItemAmountValidator extends BaseLongValidator implements Validator { /** diff --git a/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java b/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java index 4796d05c..8756a157 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java @@ -17,7 +17,6 @@ package org.mxchange.pizzaapplication.validator.password; import java.text.MessageFormat; -import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; @@ -27,17 +26,13 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; 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; -import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController; /** * A validator for validating passwords (if they match with stored) *

* @author Roland Häder */ -@FacesValidator (value = "PizzaUserPasswordValidator") +@FacesValidator ("UserPasswordValidator") public class PizzaUserPasswordValidator extends BaseStringValidator implements Validator { /** @@ -45,11 +40,6 @@ public class PizzaUserPasswordValidator extends BaseStringValidator implements V */ private static final long serialVersionUID = 48_581_795_687_317L; - /** - * User login controller - */ - private PizzaUserLoginWebSessionController userLoginController; - /** * Default constructor */ @@ -75,6 +65,8 @@ public class PizzaUserPasswordValidator extends BaseStringValidator implements V // 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); @@ -83,6 +75,7 @@ public class PizzaUserPasswordValidator extends BaseStringValidator implements V // 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: this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java b/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java index 0ed2ac57..49188057 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java @@ -30,7 +30,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator; *

* @author Roland Häder */ -@FacesValidator (value = "AbroadDialValidator") +@FacesValidator ("AbroadDialValidator") public class PizzaAbroadDialValidator extends BaseObjectValidator implements Validator { /** diff --git a/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java b/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java index f44ff67f..ffa74256 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java @@ -28,7 +28,7 @@ import org.mxchange.jcoreee.validator.number.BaseLongValidator; *

* @author Roland Häder */ -@FacesValidator (value = "PhoneNumberValidator") +@FacesValidator ("PhoneNumberValidator") public class PizzaPhoneNumberValidator extends BaseLongValidator implements Validator { /** diff --git a/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java b/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java index 60c1811f..5ad11b8e 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java @@ -28,7 +28,7 @@ import org.mxchange.jcoreee.validator.bool.BaseBooleanValidator; *

* @author Roland Häder */ -@FacesValidator (value = "PrivacyTermsCheckboxValidator") +@FacesValidator ("PrivacyTermsCheckboxValidator") public class PizzaPrivacyTermsCheckboxValidator extends BaseBooleanValidator implements Validator { /** diff --git a/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java b/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java index 89cd4abd..90f859b7 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java @@ -40,7 +40,7 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote; *

* @author Roland Häder */ -@FacesValidator (value = "UserIdValidator") +@FacesValidator ("UserIdValidator") public class PizzaUserIdValidator extends BaseLongValidator implements Validator { /**