Auto-refresh session without prompt

Greetings all,

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

Thanks,
Kyle.

Hello!

  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
            msgs.setSessionExpiredNotificationEnabled(false);

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

    @Override
    protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException {
        CubaVaadinServletService service = new MyCubaVaadinServletService(this, deploymentConfiguration);
        if (classLoader != null) {
            service.setClassLoader(classLoader);
        }
        service.init();
        return service;
    }
}
  1. In the web.xml of WEB module for app_servlet replace servlet class by your implementation:
<servlet>
        <servlet-name>app_servlet</servlet-name>
        <servlet-class>com.company.fssystemmessage.web.MyCubaApplicationServlet</servlet-class>

See the demo project: fs-systemmessage.zip (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.