Existing Spring MVC with Vaadin issue

HI Guys,

I just found the Vaadin. Its really nice. But I hit an obstacle. We have Spring MVC application and I want to integrate Vaadin to this application but without effecting currently working pages

What I tried was I introduced new url pattern for vaadin and changed the spring dispatcher’s url pattern too.

Here is the part of my web.xml


    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/applicationContext.xml
        </param-value>
    </context-param>

    <!-- Defines CommonContextListener which -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!--
[b]
 This is for Spring MVC 
[/b]
    -->
    <servlet>
        <servlet-name>existing</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>existing</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>


    <!--
[b]
 This is for Vaadin 
[/b]
    -->
    <servlet>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
        <init-param>
            <description>Vaadin application class to start</description>
            <param-name>application</param-name>
            <param-value>your.company.MyVaadinApplication</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>*.vaa</url-pattern>
    </servlet-mapping>

    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>

My existing app (actually pages) works like charm. But no luck with vaadin. No errors on tomcat console. But after few seconds Im getting following BROWSER error message.

Failed to load the widgetset: /vt/VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/com.vaadin.terminal.gwt.DefaultWidgetSet.nocache.js?1265299490192

Any workaround or other suggestion than URL pattern changing?

Thanks

Just add

<servlet-mapping>
    <servlet-name>Vaadin Application Servlet</servlet-name>
    <url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>

And maybe it’s better to use /app/* instead of *.vaa url pattern or something similar.

You could also find
this
useful. And there is also very good book about
Vaadin
. I recommend you to read that before doing anything.

Thanks Dude,

It worked.

Here are my 2 mappings



<!-- Spring -->
    <servlet-mapping>
        <servlet-name>existing</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

<!-- Vaadin -->
    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/VAADIN/*</url-pattern>
    </servlet-mapping>

Regards

But Im not sure why Vaading does not work with an extension servlet mapping

Regards