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;
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)
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-@FacesValidator (value = "PizzaUserPasswordValidator")
+@FacesValidator ("UserPasswordValidator")
public class PizzaUserPasswordValidator extends BaseStringValidator implements Validator {
/**
*/
private static final long serialVersionUID = 48_581_795_687_317L;
- /**
- * User login controller
- */
- private PizzaUserLoginWebSessionController userLoginController;
-
/**
* Default constructor
*/
// 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);
// 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