To access your SessionFactory inside your Validator

public void validate(FacesContext fContext, UIComponent component, Object value) throws ValidatorException {

                String valueBinding = "#{sessionFactory}";
// I would suggest moving that String into a public static variable where you keep your list of Spring resources by there bean name

SessionFactory sFactory = (SessionFactory)fContext.getApplication ().createValueBinding(valueBinding).getValue(fContext); // this from a static method I have to easily gaining access to any object, I cast on the calling method side, not in the static method

// whatever else you need is down there

    }


To do that make sure that you are using the org.springframework.web.jsf.DelegatingVariableResolver or the one from Spring-JSF project, which I don't use so I can't tell you what the variable resolver for it is.

Reply via email to