Vaadin web.xml setup

老子叫甜甜 提交于 2020-01-07 06:57:13

问题


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>

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...

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?

or...what should be a descent setup for web.xml. 2 days I can't go further than that :-(


回答1:


Your URL should be (since you're using Eclipse):

localhost:{Tomcat Port}/{Eclipse Project Name}/TestvaadinApplicationServlet/

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.



来源:https://stackoverflow.com/questions/5550399/vaadin-web-xml-setup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!