Auto-refresh session without prompt

Greetings all,

Can someone please point out how to implement this in Cuba 7.2?



  1. Extend CubaVaadinServletService and set systemMessageProvider in the constructor:
public class MyCubaVaadinServletService extends CubaVaadinServletService {

    public MyCubaVaadinServletService(VaadinServlet servlet, DeploymentConfiguration deploymentConfiguration) throws ServiceException {
        super(servlet, deploymentConfiguration);

        setSystemMessagesProvider(systemMessagesInfo -> {
            /* copied code from super class */

            CustomizedSystemMessages msgs = new CustomizedSystemMessages();
            // disable notification

           /* copied code from super class */
  1. Extend CubaApplicationServlet to create MyCubaVaadinServletService :
public class MyCubaApplicationServlet extends CubaApplicationServlet {

    protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException {
        CubaVaadinServletService service = new MyCubaVaadinServletService(this, deploymentConfiguration);
        if (classLoader != null) {
        return service;
  1. In the web.xml of WEB module for app_servlet replace servlet class by your implementation:

See the demo project: (84.3 KB)

In the project, I also changed the session expiration time to 10 seconds and disabled heartbeat requests for the test purpose.

This solves my problem.

Many thanks Mr. Pinyazhin.