vaadin+spring 各负其职

       昨天一天整理vaadin+spring mvc+jpa 这套东西。今天算是有点眉目了。一直搞总是弹出Failed to load the widgetset  的alert框。怎么弄就是搞不定。我一直以为mvc的servlet和vaadin的servlet有冲突。所以改他们的url。总是注销掉spring的servlet之后vaadin就可以用了。加上vaadin的servlet又不能使用了。郁闷啊。后来我发现是servlet-maping的url问题.以前写/vaadin/*就是不能用总是弹出alert框。然后改成/VAADIN/*之后就可以用了。也不知道为什么。莫非spring本身对vaadin有支持?这个就不得而知了。

ps:

可能是mvc得注释扫描不能和Vaadin的Application在同一个包下

 

附上web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Use this definition if using a Java EE 6 container This also stops Eclipse 
	from complaining that 3.0 is not a valid version <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" 
	http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> -->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	version="2.5"  id="WebApp_1314783997292">
	<!-- The definition of the Root Spring Container shared by all Servlets 
		and Filters -->
<context-param>
    <param-name>productionMode</param-name>
    <param-value>false</param-value>
  </context-param>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/spring/root-context.xml</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<servlet>
		<servlet-name>appServlet</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>/WEB-INF/spring/app/servlet-context.xml</param-value>
		</init-param>
			 <load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>appServlet</servlet-name>
		<url-pattern>/spring/*</url-pattern>
	</servlet-mapping>

		 <!-- 创建vaadin的servlet -->
  <servlet>
    <servlet-name>HelloWord</servlet-name>
    <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>com.xq.vaadin.HelloWorld</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>HelloWord</servlet-name>
    <url-pattern>/VAADIN/*</url-pattern>
  </servlet-mapping>
</web-app>

 

你可能感兴趣的:(spring,mvc,Servlets,servlet,application,webapp)