问题描述
我有一个vaadin应用程序,我正在尝试提供一些由Spring MVC提供的REST URL - 我的web.xml在下面。我只在/ info获得404s - 似乎Vaadin窃取所有网址模式。
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.
如果我删除Vaadin,我可以访问/ info并获取该网址的内容。如何让他们一起玩得很好?
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>
推荐答案
感谢Vaadin论坛的帮助,答案结果是是使用/ info / *而不是/ info。
抱歉 - 由于我最初忘记在问题中包含/ info servlet,我没有轻易回答!
Thanks to help from Vaadin forum the answered turned out to be to use /info/* rather than /info. Sorry - I didn't make it easy to answer as I initially forgot to include the /info servlet in the question!
这篇关于如何阻止vaadin窃取所有url模式(并与spring mvc很好地玩)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!