Example usage for com.vaadin.server VaadinServletService getDeploymentConfiguration

List of usage examples for com.vaadin.server VaadinServletService getDeploymentConfiguration

Introduction

In this page you can find the example usage for com.vaadin.server VaadinServletService getDeploymentConfiguration.

Prototype

public DeploymentConfiguration getDeploymentConfiguration() 

Source Link

Document

Gets the deployment configuration.

Usage

From source file:com.klwork.explorer.web.CustomVaadinServlet.java

License:Apache License

@Override
protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration)
        throws ServiceException {
    final VaadinServletService service = super.createServletService(deploymentConfiguration);

    // Spring system messages provider
    if (systemMessagesBeanName != null && systemMessagesBeanName != "") {
        SpringVaadinSystemMessagesProvider messagesProvider = new SpringVaadinSystemMessagesProvider(
                applicationContext, systemMessagesBeanName);
        logger.debug("set SpringVaadinSystemMessagesProvider");
        service.setSystemMessagesProvider(messagesProvider);
    }//from w w w  . j a v a2 s  . com

    String uiProviderProperty = service.getDeploymentConfiguration()
            .getApplicationOrSystemProperty(Constants.SERVLET_PARAMETER_UI_PROVIDER, null);

    // Add SpringUIProvider if custom provider doesn't defined.
    if (uiProviderProperty == null) {
        service.addSessionInitListener(new SessionInitListener() {
            @Override
            public void sessionInit(SessionInitEvent event) throws ServiceException {
                //UIPROVIDER,CommunicationManager
                event.getSession().addUIProvider(new SpringUIProvider());
            }
        });
    }

    return service;
}

From source file:pl.exsio.frameset.vaadin.bootstrap.servlet.FramesetServlet.java

License:Open Source License

protected void initializeApplication(VaadinServletService service) {
    if (this.systemMessagesBeanName != null && !"".equals(this.systemMessagesBeanName)) {
        FramesetSystemMessagesProvider messagesProvider = new FramesetSystemMessagesProvider(
                this.applicationContext, this.systemMessagesBeanName);
        service.setSystemMessagesProvider(messagesProvider);
    }/* ww  w  . j  a v  a  2  s .  c  o  m*/

    String uiProviderProperty = service.getDeploymentConfiguration()
            .getApplicationOrSystemProperty(Constants.SERVLET_PARAMETER_UI_PROVIDER, null);

    if (uiProviderProperty == null) {
        service.addSessionInitListener(new SessionInitListener() {
            @Override
            public void sessionInit(SessionInitEvent event) throws ServiceException {
                event.getSession().addUIProvider(new FramesetUIProvider());
            }
        });
    }
}