Wrong (throw NullException):
@Autowired
private FooService fooService;
Right:
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
FooService fooService = (FooService) FacesContextUtils.getWebApplicationContext(facesContext).getBean("fooService");
}
No comments:
Post a Comment