Vaadin 7.1.0 - DefaultWidgetSet无法找到。

[en]Vaadin 7.1.0 - DefaultWidgetSet can't be found


I am new to Vaadin and I am trying to do some Tests with this technology. I Set up my project as a Maven Project under Eclipse with a Tomcat 7 Server.

我是瓦丁的新手,我试着用这项技术做一些测试。我用Tomcat 7服务器在Eclipse下创建了一个Maven项目。

At first I started with Vaadin 7.0.0 and everything works fine. Now I change the Version from 7.0.0 to 7.1.0 because I like to test the push functionality. With Vaadin 7.0.0 everything works fine, but since I changed the Version I get the error:

起初,我从Vaadin 7.0.0开始,一切正常。现在我将版本从7.0.0更改为7.1.0,因为我喜欢测试推送功能。由于Vaadin 7.0.0,一切都很正常,但自从我更改了版本后,我得到了错误:

Requested resource [/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet   /com.vaadin.DefaultWidgetSet.nocache.js] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

I've read that the DefaultWidget is created by Vaadin but how can I do that?

我已经读过了,DefaultWidget是由Vaadin创建的,但是我该怎么做呢?

2 个解决方案

#1


1  

Unless you add new client-side components to a Vaadin project, you don't need to compile a WidgetSet. However, the default configuration of Vaadin assumes that you have one. To get past this error simply remove the <init-param> tag for the widgetset in your web.xml.

除非在Vaadin项目中添加新的客户端组件,否则不需要编译一个WidgetSet。但是,Vaadin的默认配置假设您有一个。要克服这个错误,只需删除web.xml中widgetset的 标记。

<servlet>
    <servlet-name>Your-SERVLET-NAME</servlet-name>
    <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
    <init-param>
        <param-name>UI</param-name>
        <param-value>com.example.MyUI</param-value>
    </init-param>
    <init-param>
        <param-name>widgetset</param-name>
        <param-value>another.path</param-value>
    </init-param>
</servlet>

Alternatively, you can create an .xml file in the same package (e.g. MyWSet.xml) as your UI class, and reference it in your web.xml.

或者,您可以在同一个包中创建一个.xml文件(例如MyWSet.xml)作为UI类,并在web.xml中引用它。

MyWSet.xml in com.example package:

MyWSet。xml在com。示例包:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet" />
</module>

The right web.xml:

正确的web . xml:

<servlet>
    <servlet-name>Your-SERVLET-NAME</servlet-name>
    <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
    <init-param>
        <param-name>UI</param-name>
        <param-value>com.example.MyUI</param-value>
    </init-param>
    <init-param>
        <param-name>widgetset</param-name>
        <param-value>com.example.MyWSet</param-value>
    </init-param>
</servlet>

Remember, you don't need the .xml suffix in your web.xml. Finally, run mvn vaadin:compile to compile this widgetset.

记住,在web.xml中不需要.xml后缀。最后,运行mvn vaadin:编译这个widgetset。

#2


0  

Adding vaadin-client-compiled worked for me as mentioned in https://vaadin.com/forum/thread/2485026/2496683

在https://vaadin.com/forum/thread/2485026/2496683中添加了vaadin-client-编译的工作。

<dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
        </dependency>



注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
© 2014-2018 ITdaan.com 粤ICP备14056181号