Java 如何使用vaadin上传图像
我有一种htmlJava 如何使用vaadin上传图像,java,vaadin,Java,Vaadin,我有一种html <html> <head> <title>Upload a file please</title> </head> <body> <h1>Please upload a file</h1> <form method="post" action="http://localhost:8080/service/u
<html>
<head>
<title>Upload a file please</title>
</head>
<body>
<h1>Please upload a file</h1>
<form method="post" action="http://localhost:8080/service/uploadFile" enctype="multipart/form-data">
<input type="text" name="name"/>
<input type="file" name="file"/>
<input type="submit"/>
<input type="hidden" name="smallSize" value="50x50">
<input type="hidden" name="mediumSize" value="100x100">
<input type="hidden" name="largeSize" value="150x150">
</form>
</body>
</html>
请上传一个文件
请上传一个文件
我想使用Vaadin Upload
组件
?如何实现这一点 您不能将普通html页面与处理“结果”的vaadin混合使用
他们的方法是在html页面中嵌入vaadin
看这里:
我用它。
例如:
您可以使用vaadin upload上载一个启用属性(maxfiles)的图像
final UploadField uploadField = new UploadField();
Button b = new Button("Show value");
b.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
Object value = uploadField.getValue();
mainWindow.showNotification("Value:" + value);
}
});