I have a vaadin application and I am trying to provide some REST Urls provided by spring MVC alongside - my web.xml is below. I only get 404s at /info - it seems like Vaadin steals all the url patterns.
If I remove Vaadin, I can reach /info and get content at that url. How to I get them to play nicely together?
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<description>Vaadin production mode</description>
<param-name>productionMode</param-name>
<param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>Vaadin Application Servlet</servlet-name>
<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
<!-- replace standard applicationServlet with the ICEpush one -->
<!--<servlet-class>org.vaadin.artur.icepush.ICEPushServlet</servlet-class>-->
<init-param>
<description>Vaadin application class to start</description>
<param-name>application</param-name>
<param-value>myapp.vaadin.MyVaadinApp</param-value>
</init-param>
<init-param>
<param-name>widgetset</param-name>
<param-value>myapp.gwt.MyAppWidgetSet</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>info</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>info</servlet-name>
<url-pattern>/info</url-pattern>
</servlet-mapping>
The url-pattern for the Vaadin servlet is /* which is a wild-card for everything so that servlet will handle every request. One option is to narrow the urls for the Vaadin servlet to something more specific than /*.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With