67,513
社区成员
发帖
与我相关
我的任务
分享
<s:file name="upload" id="upload" style="width:260px; height:23px;"/>
Action中
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
String targetDirectory = context.getRealPath("/upload/detail");
String targetFileName = uploadFileName;
if (targetFileName != null) {
File target = new File(targetDirectory, targetFileName);
FileUtils.copyFile(upload, target);
setUploadFileName(target.getPath());
对象 对象名 = new 对象();
对象名.setlocal("/upload/detail/"+targetFileName);
保存对象入库;