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

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%@ page import="com.vnex.intranet.commoninfo.directory.value.*"%>
  3. <%@ page import="com.vnex.intranet.commoninfo.directory.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="directoryProxy" class="com.vnex.intranet.commoninfo.directory.proxy.DirectoryProxyBean" scope="application" />
  10. <jsp:useBean id="directoryBean" class="com.vnex.intranet.commoninfo.directory.value.DirectoryValueBean" 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("directoryAttachmentUrl");
  15.   String directoryName = "";
  16.   String directoryDepartment = "";
  17.   int directoryId = 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("directoryName")!=null && !multi.getParameter("directoryName").equals(""))
  32.     {
  33.       directoryName = (String) multi.getParameter("directoryName");
  34.       directoryBean.setDirectoryName(directoryName);
  35.     }
  36.   if(multi.getParameter("directoryDepartment")!=null && !multi.getParameter("directoryDepartment").equals(""))
  37.     {
  38.       directoryDepartment = (String) multi.getParameter("directoryDepartment");
  39.       directoryBean.setDirectoryDepartment(directoryDepartment);
  40.     }
  41.   if(multi.getParameter("directoryId")!=null && !multi.getParameter("directoryId").equals(""))
  42.     {
  43.       directoryId = Integer.parseInt((String) multi.getParameter("directoryId"));
  44.       directoryBean.setDirectoryId(directoryId);
  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.     directoryBean.setAttachmentUrl(url);
  52.   }
  53.   
  54.   directoryProxy.createDirectory(directoryBean);
  55.   response.sendRedirect("/mainctrl/commoninfo/directory/getDirectoryList");
  56. %>