Regulation_Create_Success.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:3k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%@ page import="com.vnex.intranet.commoninfo.regulation.value.*"%>
  3. <%@ page import="com.vnex.intranet.commoninfo.regulation.proxy.*"%>
  4. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
  5. <%@ page import="com.vnex.intranet.util.*"%>
  6. <%@ page import="com.vnex.intranet.upload.*"%>
  7. <%@ page import="java.util.*" %>
  8. <%@ page import="java.sql.*" %>
  9. <jsp:useBean id="regulationProxy" class="com.vnex.intranet.commoninfo.regulation.proxy.RegulationProxyBean" scope="application" />
  10. <jsp:useBean id="regulationBean" class="com.vnex.intranet.commoninfo.regulation.value.RegulationValueBean" scope="page" />
  11. <jsp:useBean id="myUpload" scope="page" class="com.vnex.intranet.upload.SmartUpload" />
  12. <%
  13.   String root = ConfigParaLoader.getParameter("rootUrl");
  14.   String attachURL = ConfigParaLoader.getParameter("regulationAttachmentUrl");
  15.   String regulationName = "";
  16.   String regulationDepartment = "";
  17.   int regulationId = 0;
  18.   
  19. // Initialization 
  20.    myUpload.initialize( pageContext ); 
  21.    myUpload.setTotalMaxFileSize( Integer.parseInt(ConfigParaLoader.getParameter("attachmentSize")) );
  22. // SubPathGenerater
  23.    attachURL += SubPathGenerater.getSubPath( root + SubPathGenerater.getSeperator() + attachURL);
  24.    
  25. // Upload        
  26.    myUpload.upload(); 
  27.    myUpload.save( root + attachURL );
  28.    
  29.   com.vnex.intranet.upload.Request multi = myUpload.getRequest();
  30.   
  31.   if(multi.getParameter("regulationName")!=null && !multi.getParameter("regulationName").equals(""))
  32.     {
  33.       regulationName = (String) multi.getParameter("regulationName");
  34.       regulationBean.setRegulationName(regulationName);
  35.     }
  36.   if(multi.getParameter("regulationDepartment")!=null && !multi.getParameter("regulationDepartment").equals(""))
  37.     {
  38.       regulationDepartment = (String) multi.getParameter("regulationDepartment");
  39.       regulationBean.setRegulationDepartment(regulationDepartment);
  40.     }
  41.   if(multi.getParameter("regulationId")!=null && !multi.getParameter("regulationId").equals(""))
  42.     {
  43.       regulationId = Integer.parseInt((String) multi.getParameter("regulationId"));
  44.       regulationBean.setRegulationId(regulationId);
  45.     }
  46.   
  47.   com.vnex.intranet.upload.File myFile = myUpload.getFiles().getFile(0); 
  48.   if (!myFile.isMissing())   
  49.   {
  50.     String url = attachURL +SubPathGenerater.getSeperator()+ myFile.getFileName();
  51.     regulationBean.setAttachmentUrl(url);
  52.   }
  53.   
  54.   regulationProxy.createRegulation(regulationBean);
  55.   response.sendRedirect("/mainctrl/commoninfo/regulation/getRegulationList");
  56. %>