java - vaadin 8 + spring 自定义小部件集

标签 java spring maven gwt vaadin

我正在尝试使用 spring+vaadin boot 来使用类来工作客户端组件。

问题可能出在自定义小部件集中。应该放在项目的什么地方?靠近客户端组件?资源(在资源中无法编译)

但是我的客户端组件没有被调用 onStateChange。我已经尝试了一切,但我无法处理它。

gwt package {
client {
connector extended by AbstractExtensionConnector with @Connect directivy 
ClientSide class with java
}
AppWidgetset.gwt.xml
}

impl
{
server {
Class with AbstractExtension
}

}


pom.xml
     <plugin>
     <groupId>com.vaadin</groupId>
     <artifactId>vaadin-maven-plugin</artifactId>
     <version>${vaadin.plugin.version}</version>
     <configuration>
     <extraJvmArgs>-Xmx1G -Xss1G</extraJvmArgs>

   <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
     <hostedWebapp>${basedir}/target/classes/VAADIN/widgetsets</hostedWebapp>
     <noServer>true</noServer>
     <persistentunitcachedir>${basedir}/target/tmp/gwt-unitCache</persistentunitcachedir>
     <compileReport>true</compileReport>
     <strict>true</strict>
     </configuration>
     <executions>
    <execution>
    <goals>
    <goal>update-theme</goal>
    <goal>update-widgetset</goal>
    <goal>compile
    </goal> <!-- Comment out compile-theme goal to use on-the-fly theme 
    compilation -->
     <goal>compile-theme</goal>
     </goals>enter code here
     </execution>
     </executions>

     </plugin>

最佳答案

您将 WidgetSet.gwt.xml 文件放在 src/main/resources 中与您的小部件类匹配的文件夹中。

如果我有我的小部件

src/main/java/com/m1kah/vaadinapp/mywidget/MyWidget.java

然后我的小部件集文件将位于此位置

src/main/resources/com/m1kah/vaadinapp/mywidget/Widgetset.gwl.xml

CSS 样式和其他“公共(public)”文件位于 public 文件夹中的同一资源路径中。

关于java - vaadin 8 + spring 自定义小部件集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47477888/

相关文章:

java - Java中用计算结果的值替换JTable的值

spring - 使用 Spring 3.0.5 和 Jackson 向 Tomcat 发出 JSON PUT 请求时出现 403

java - 没有找到接口(interface) org.springframework.data.jpa.domain.Specification] 的主要或默认构造函数,其根本原因

java - 在 pom 中添加依赖项时缺少 Artifact 错误

Java Scanner Class 错误字符 "®"

java - 如何使用appium调用adb命令?

Java : How to accommodate special characters in the filename while uploading and downloading the file?

java - 使用 Spring 和 Maven 的模块化 Web 应用程序

java - Maven 复制依赖项与定义依赖项

java - 如何从存储过程返回多行?