Vaadin Formsender 添加 - ClassNotFoundException
Vaadin Formsender Add on - ClassNotFoundException
我正在使用 vaadin 7 并尝试使用 formsender 插件。我添加了以下依赖项,
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>canvas</artifactId>
<version>2.1</version>
</dependency>
但是我在启动服务器时仍然收到以下错误。我四处搜索但找不到需要什么依赖项。我有一种感觉,这是 vaadin 6 的一部分。如果是这样,那么 vaadin 7 相当于 FormSender 的是什么?
Caused by: java.lang.ClassNotFoundException: com.vaadin.terminal.PaintTarget
简单的测试程序,
package grouptest;
import javax.servlet.annotation.WebServlet;
import org.vaadin.risto.formsender.FormSender;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
/**
* This UI is the application entry point. A UI may either represent a browser window
* (or tab) or some part of a html page where a Vaadin application is embedded.
* <p>
* The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
* overridden to add component to the user interface and initialize non-component functionality.
*/
@SuppressWarnings("serial")
@Theme("mytheme")
@Widgetset("grouptest.MyAppWidgetset")
public class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final FormSender formSender = new FormSender();
formSender.setFormMethod(FormSender.Method.POST);
formSender.setFormTarget("http://localhost:8080/birt/frameset");
formSender.addValue("__report", "erro.rptdesign");
System.out.println(formSender.getValues());
Button button = new Button("Click Me");
button.addClickListener( e -> {
formSender.submit();
});
layout.addComponents(button, formSender);
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}
我不确定版本,但对于 class,您必须为
添加依赖项
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.2.3</version>
</dependency>
我正在使用 vaadin 7 并尝试使用 formsender 插件。我添加了以下依赖项,
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>canvas</artifactId>
<version>2.1</version>
</dependency>
但是我在启动服务器时仍然收到以下错误。我四处搜索但找不到需要什么依赖项。我有一种感觉,这是 vaadin 6 的一部分。如果是这样,那么 vaadin 7 相当于 FormSender 的是什么?
Caused by: java.lang.ClassNotFoundException: com.vaadin.terminal.PaintTarget
简单的测试程序,
package grouptest;
import javax.servlet.annotation.WebServlet;
import org.vaadin.risto.formsender.FormSender;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
/**
* This UI is the application entry point. A UI may either represent a browser window
* (or tab) or some part of a html page where a Vaadin application is embedded.
* <p>
* The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
* overridden to add component to the user interface and initialize non-component functionality.
*/
@SuppressWarnings("serial")
@Theme("mytheme")
@Widgetset("grouptest.MyAppWidgetset")
public class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final FormSender formSender = new FormSender();
formSender.setFormMethod(FormSender.Method.POST);
formSender.setFormTarget("http://localhost:8080/birt/frameset");
formSender.addValue("__report", "erro.rptdesign");
System.out.println(formSender.getValues());
Button button = new Button("Click Me");
button.addClickListener( e -> {
formSender.submit();
});
layout.addComponents(button, formSender);
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}
我不确定版本,但对于 class,您必须为
添加依赖项<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.2.3</version>
</dependency>