JSP:
<s:form action="FileUpload" enctype="multipart/form-data">
<s:form action="FileUpload" enctype="multipart/form-data">
<s:file name="upload" label="File"></s:file>
<s:submit/>
</s:form>
Action:
public class FileUpload extends ActionSupport {
Action:
public class FileUpload extends ActionSupport {
private File file;
private String contentType;
private String filename;
@Override
public String execute() throws Exception {
return super.execute();
}
public void setUpload(File file) {
this.file = file;
}
public void setUploadContentType(String contentType) {
this.contentType = contentType;
}
public void setUploadFileName(String filename) {
this.filename = filename;
}
}
No comments:
Post a Comment