上传附件

 //点击附件按钮之前先保存表单内容
 function addAttach(){
  
  document.myform.addAttachFlag.value="1";//设置标记
  beforeSave('');//保存方法
 }

<input type="hidden" name="addAttachFlag" value="">//form里取addAttachFlag的值,form为附件所在form
    // 后台取得附件参数
    String addAttachFlag=request.getParameter("addAttachFlag");
    session.setAttribute("addAttachFlag",addAttachFlag);
//把附件参数取到网页里来
String  addAttachFlag=(String)session.getAttribute("addAttachFlag");(强制转型为String型)
request.setAttribute("addAttachFlag",addAttachFlag);(用request在网页上设一次,因网页中的标签是从request中取得)


 //如果新附件标记为1则弹出附件窗口

 <logic:equal name="addAttachFlag" value="1">
  
  var tkid = document.myform.TASKBILLID.value;
  url ="/seperp/AttachmentAction.do?method=getAttachList&pclass=继保定值管理&upload=enables&iframeName=iframe1&delete=yes&relativeid=" + tkid + "&tablename=tabfixvalinfo";

  window.open(url,"","scrollbars=1");
  </logic:equal>//iframeName=iframe1刷新动作show=1显示
 <%    session.removeAttribute("addAttachFlag");%>//删除addAttachFlag