Vaadin Spring add-on with TouchKit add-on

Dear all,
We have built our soulution on the touchkit add-on. Right now our application is running pretty wel. Anyway we have decided that regarding the rising app complexity would be better to over do our app using the Spring add-on. The issue is that we extend TouchKitServlet to set TouchKitSettings etc… and we would like to also use (extend) SpringVaadinServlet.

Is there any possibility to use both of them TouchKitServlet and SpringVaadinServlet? We use Spring application initializer to boot our spring context:

public class ApplicationInitializer implements WebApplicationInitializer {

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();

        context.scan(ApplicationInitializer.class.getPackage().getName());
        servletContext.addListener(new ContextLoaderListener(context));
        registerServlet(servletContext);
    }

    private void registerServlet(ServletContext servletContext) {
        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("vaadin", SpringVaadinServlet.class);
        dispatcher.setInitParameter("ui", MyVaadinUI.class.getName());
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping("/*");

Hi,

You have to “manually merge” the functionality of the two servlets. I have done it like this:

https://github.com/mstahv/vaadin-spring-touchkit

Sorry it took ages to respond, I have been on vacations and too little time to go through all messages.

cheers,
matti

Hi Matti,

it works!

Tahanks a lot.