具有属性文件设计的密码验证器

时间:2012-02-28 08:36:09

标签: spring validation jsf java-ee

我有一个验证器组件:

@Component("passwordValidator")
@Scope("view")
public class PasswordValidator implements Validator {

    private int maxPasswordLength;

}

我想从属性文件中设置属性maxPasswordLength的值 我在使用依赖注入的构建时间或在validate方法或@PostConstrcut方法中的每次验证期间设置它时感到困惑?

你觉得怎么样?

1 个答案:

答案 0 :(得分:0)

JSF 2.0和2.1在验证器中不尊重@ PostConstruct,@ Resource,@ Inject等。 JSF 2.2应该为此提供支持。