在你的web.xml中,你可以写链接,以将您的应用程序使用,它的意思是thanxx http://localhost:{port}/your-application
<servlet>
<servlet-name>your-application</servlet-name>
<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>package.YourApplication</param-value>
</init-param>
<init-param>
<param-name>widgetset</param-name>
<param-value>com.vaadin.terminal.gwt.DefaultWidgetSet</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>your-application</servlet-name>
<url-pattern>/your-application-link/*</url-pattern>
</servlet-mapping>
这是一种方式,但是如果你在项目中使用Spring更有可能使用调度程序servlet来启动Vaadin应用程序。 在web.xml文件
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
创建文件调度-servlet.xml中
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="applicationServlet" class="org.springframework.web.servlet.mvc.ServletWrappingController" p:servletClass="package.YourApplication">
<property name="initParameters">
<props>
<prop key="application">package.YourApplication</prop>
<prop key="widgetset">com.vaadin.terminal.gwt.DefaultWidgetSet</prop>
</props>
</property>
</bean>
<!-- Map URIs to web controllers -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/" value-ref="redirectController" />
<entry key="/favicon.ico" value-ref="applicationServlet" />
<entry key="/VAADIN*/**" value-ref="applicationServlet" />
<entry key="/UIDL*/**" value-ref="applicationServlet" />
<entry key="/your-application" value-ref="applicationServlet" />
</map>
</property>
</bean>
</beans>
里面urlMap您可以用链接写允许初始化。你的vaadin应用程序。
创建redirectController
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller("redirectController")
public class RedirectController {
@RequestMapping
protected ModelAndView handleRequestInternal() throws Exception {
return new ModelAndView("redirectView");
}
}
你能后的堆栈跟踪(S)如果有当Tomcat启动? – Raghuram 2011-01-10 04:39:38