我成功部署了一个Vaadin应用程序,但在调用它时,我看到ERROR : NOT_FOUND
我想我找不到我的默认页面,因为错误选择了默认页面。
问题: 我如何指向(我在我的web.xml中)我的默认页面?
我的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>GoogleAppVaadin701Project</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
答案 0 :(得分:0)
Vaadin eclipse插件不会创建适用于vaadin应用程序的web.xml。在vaadin一书中,您可以找到关于web.xml的部分 - https://vaadin.com/book/vaadin7/-/page/application.environment.html
以下是基于本书的基本servlet定义和映射,工作正常。只需更改UI参数以指向您的UI实现
<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>
com.vaadin.server.GAEVaadinServlet
</servlet-class>
<init-param>
<param-name>UI</param-name>
<param-value>com.example.higoogle.HigoogleUI</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>