前台的主要代码是:
 
       function saveDoc(){
if(!validator.validate()){
return;
} var docForm = document.getElementsByName("docForm")[0];
var docid = docForm["gm.docid"].value;
if(!docid || docid.length==0){
docForm.action = "<%=request.getContextPath()%>/fxbusiness/gongwenAction!create.action";
}else{
docForm.action = "<%=request.getContextPath()%>/fxbusiness/gongwenAction!update.action";
}

    docForm.submit();
window.returnValue = "1";//表示要刷新列表窗口

}
后台的主要代码是:
           public String update() {
try {
if (file != null && fileFileName != null
&& fileFileName.length() > 0) {
System.out.println("fileFileName : " + fileFileName
+ ", fileSize : " + file.length());
String path = ServletActionContext.getServletContext()
.getRealPath(APPENDIX_PATH);
String fileNewName = file.getName().substring(0,
file.getName().lastIndexOf("."))
+ fileFileName.substring(fileFileName.lastIndexOf("."));
                            FileUtils.copyFile(file, new File(path
+ System.getProperty("file.separator") + fileNewName));
gm.setDocpath(fileNewName);
gm.setAffixfiles(fileFileName);
file.delete();

}
} catch (Exception e) {
e.printStackTrace();
ServletActionContext.getRequest().setAttribute("message",
e.getMessage());
return "error";
}
manage.update(gm);
return SUCCESS;
}
===============
  public String create() {
try {
if (file != null && fileFileName != null
&& fileFileName.length() > 0) {
String path = ServletActionContext.getServletContext()
.getRealPath(APPENDIX_PATH);
String fileNewName = file.getName().substring(0,
file.getName().lastIndexOf("."))
+ fileFileName.substring(fileFileName.lastIndexOf("."));
FileUtils.copyFile(file, new File(path
+ System.getProperty("file.separator") + fileNewName));
gm.setDocpath(fileNewName);
gm.setAffixfiles(fileFileName);
file.delete();
}
} catch (Exception e) {
e.printStackTrace();
  throw new TechnicalException("文件的大小不能为0,或文件在上传过程中出错!");
}
manage.create(gm);
return SUCCESS;
}求高手指点啊 !!!!