get Spring bean from application context in JSF

JSF Renderer to get bean in Spring context 
@Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
      //get Spring Context
        WebApplicationContext appCtx = FacesContextUtils.getRequiredWebApplicationContext(context);
        BeanClass bean = (BeanClass)appCtx.getBean("beanId");

你可能感兴趣的:(spring,bean,JSF)