List of usage examples for com.vaadin.server VaadinSession getUIProviders
public List<UIProvider> getUIProviders()
From source file:fr.univlorraine.mondossierweb.utils.MdwSpringVaadinServlet.java
License:Apache License
@Override protected void servletInitialized() throws ServletException { getService().addSessionInitListener(new SessionInitListener() { private static final long serialVersionUID = -6307820453486668084L; @Override/*from w w w . ja v a 2 s.co m*/ public void sessionInit(SessionInitEvent sessionInitEvent) throws ServiceException { WebApplicationContext webApplicationContext = WebApplicationContextUtils .getWebApplicationContext(getServletContext()); // remove DefaultUIProvider instances to avoid mapping // extraneous UIs if e.g. a servlet is declared as a nested // class in a UI class VaadinSession session = sessionInitEvent.getSession(); List<UIProvider> uiProviders = new ArrayList<UIProvider>(session.getUIProviders()); for (UIProvider provider : uiProviders) { // use canonical names as these may have been loaded with // different classloaders if (DefaultUIProvider.class.getCanonicalName().equals(provider.getClass().getCanonicalName())) { session.removeUIProvider(provider); } } // add Spring UI provider SpringUIProvider uiProvider = new MdwUIProvider(webApplicationContext); session.addUIProvider(uiProvider); } }); }