خرید بک لینک

Vote count: 0

I am trying to build simple backoffice app. I choose to use jsf(PrimeFaces) because of rich ui components that doesn't require any Front end developer(The look doesn't matter it just to perform actions on our main system).

The issue that i have is that @ManagedBean doesn't work at all.. It just doesn't consider it and does not perform auto scan.

In case i put the bean in faces-config.xml it works.. Anyone has an idea?

The config file is:

@Bean
public FacesServlet facesServlet() {
    retu new FacesServlet();
}

@Bean
public ServletRegistrationBean facesServletRegistration() {
    ServletRegistrationBean registration = new ServletRegistrationBean(facesServlet(), new String[] { "*.xhtml", "*.jsf" });
    registration.setName("FacesServlet");
    registration.setLoadOnStartup(1);
    retu registration;
}

@Configuration
static class ConfigureJSFContextParameters implements ServletContextInitializer {

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        servletContext.setInitParameter("com.sun.faces.forceLoadConfiguration", "true");
        servletContext.setInitParameter("javax.faces.DEFAULT_SUFFIX", ".xhtml");
        servletContext.setInitParameter("com.sun.faces.forceLoadConfiguration", Boolean.TRUE.toString());
        servletContext.setInitParameter("encoding", "UTF-8");
        servletContext.setInitParameter("facelets.SKIP_COMMENTS", Boolean.TRUE.toString());
    }
}

@Bean
public ServletListenerRegistrationBean<ConfigureListener> jsfConfigureListener() {
    retu new ServletListenerRegistrationBean<ConfigureListener>(new ConfigureListener());
}

asked 6 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 18 خرداد 1395 ساعت: 15:14

صفحه بندی