我正在尝试使用 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/