Vaadin web.xml 设置 [英] Vaadin web.xml setup
问题描述
我有这个 web.xml :
I have this web.xml :
<?xml version="1.0" encoding="UTF-8"?><web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>TestVaadin</display-name>
<context-param>
<description>
Vaadin production mode</description>
<param-name>productionMode</param-name>
<param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>TestvaadinApplication</servlet-name>
<servlet-class>
com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
<init-param>
<description>
Vaadin application class to start</description>
<param-name>application</param-name>
<param-value>com.example.testvaadin.TestvaadinApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>TestvaadinApplication</servlet-name>
<url-pattern>/TestvaadinApplicationServlet/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TestvaadinApplication</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<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>
我正在尝试从 Eclipse 进行调试,我是新手,但我不明白为什么我在默认的 http 帖子中得到 404,或者如果我调用/VAADIN/得到 500.无论我做什么,我都没有得到代码的结果.Vaadin 没有说太多,所以我浏览了许多关于 gwt 的网站...
I am trying to debug from eclipse, and I am new at this, but I can't understand why I get 404 at te default http post, or 500 if I call /VAADIN/ instead. What ever I do, I don't get the result of the code. Vaadin doesn't say much so I go around with numerous sites about gwt...
相反,如果我在 Firefox 中执行此操作,使用/VAADIN/我会得到一些下降视图.有没有人知道我的地址 url 应该是什么才能正确指向这个 web.xml?
On the contrary, if I do it in firefox, with /VAADIN/ I get some descent view. does anyone have a clue what should be my address url to point correctly with this web.xml?
或者...什么应该是 web.xml 的下降设置.2 天我不能走得更远:-(
or...what should be a descent setup for web.xml. 2 days I can't go further than that :-(
推荐答案
您的 URL 应该是(因为您使用的是 Eclipse):
Your URL should be (since you're using Eclipse):
localhost:{Tomcat 端口}/{Eclipse 项目名称}/TestvaadinApplicationServlet/
localhost:{Tomcat Port}/{Eclipse Project Name}/TestvaadinApplicationServlet/
如果我没记错的话,Eclipse 会自动为您创建一个 *.war 并将其部署到您的 Tomcat 安装的/webapps 目录中(假设您使用的是 Tomcat),默认情况下该 war 以 Eclipse 项目命名.
If I'm not mistaken Eclipse automatically creates a *.war for you and deploys it to the /webapps directory of your Tomcat install (assuming you're using Tomcat), that war is by default named after the Eclipse project.
这篇关于Vaadin web.xml 设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!