gpt4 book ai didi

java - Vaadin Formsender 添加 - ClassNotFoundException

转载 作者:行者123 更新时间:2023-11-30 07:31:58 25 4
gpt4 key购买 nike

我正在使用 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 {
}
}

最佳答案

我不确定版本,但对于类,您必须添加依赖项

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.2.3</version>
</dependency>

关于java - Vaadin Formsender 添加 - ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35984603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com