Reputation: 3270
I'm using Vaadin for the first time , and i'm working on a web application deployed in Tomcat 7 server . I want to upload files into a specific directory in the server and i want them to be stored there. So how to do it with Tomcat, Here's the code :
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
// Create the Upload component.
Upload reportUpload = new Upload("Upload the report folder here",null);
reportUpload.setButtonCaption("Upload The Report");
Button reporGenearationbtn = new Button("Generate Report");
reporGenearationbtn.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
layout.addComponent(new Label("Thank you for clicking"));
}
});
layout.addComponent(reportUpload);
layout.addComponent(reporGenearationbtn);
}
Upvotes: 0
Views: 474
Reputation: 4754
This has nothing to do with tomcat, it is handled by vaadin.
Look the the book of vaadin for a example.
https://vaadin.com/de/book/vaadin7/-/page/components.upload.html
Upvotes: 2