Regulation_Modify_Success.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:3k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="com.vnex.intranet.commoninfo.regulation.value.*"%>
- <%@ page import="com.vnex.intranet.commoninfo.regulation.proxy.*"%>
- <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
- <%@ page import="com.vnex.intranet.util.*"%>
- <%@ page import="com.vnex.intranet.upload.*"%>
- <%@ page import="java.util.*" %>
- <%@ page import="java.sql.*" %>
- <%@ page import="java.io.*" %>
- <jsp:useBean id="regulationProxy" class="com.vnex.intranet.commoninfo.regulation.proxy.RegulationProxyBean" scope="application" />
- <jsp:useBean id="regulationBean" class="com.vnex.intranet.commoninfo.regulation.value.RegulationValueBean" scope="page" />
- <jsp:useBean id="myUpload" scope="page" class="com.vnex.intranet.upload.SmartUpload" />
- <%
- String root = ConfigParaLoader.getParameter("rootUrl");
- String attachURL = ConfigParaLoader.getParameter("regulationAttachmentUrl");
- String oldUrl = "";
- String regulationName = "";
- String regulationDepartment = "";
- int regulationId = 0;
- int start = 1;
- // Initialization
- myUpload.initialize( pageContext );
- myUpload.setTotalMaxFileSize( Integer.parseInt(ConfigParaLoader.getParameter("attachmentSize")) );
- // Upload
- myUpload.upload();
- com.vnex.intranet.upload.Request multi = myUpload.getRequest();
- if(multi.getParameter("start")!=null && !multi.getParameter("start").equals(""))
- {
- start = Integer.parseInt(multi.getParameter("start"));
- }
- if(multi.getParameter("regulationName")!=null && !multi.getParameter("regulationName").equals(""))
- {
- regulationName = (String) multi.getParameter("regulationName");
- regulationBean.setRegulationName(regulationName);
- }
- if(multi.getParameter("regulationDepartment")!=null && !multi.getParameter("regulationDepartment").equals(""))
- {
- regulationDepartment = (String) multi.getParameter("regulationDepartment");
- regulationBean.setRegulationDepartment(regulationDepartment);
- }
- if(multi.getParameter("regulationId")!=null && !multi.getParameter("regulationId").equals(""))
- {
- regulationId = Integer.parseInt((String) multi.getParameter("regulationId"));
- regulationBean.setRegulationId(regulationId);
- }
- com.vnex.intranet.upload.File myFile = myUpload.getFiles().getFile(0);
- if(myFile.getFileName()!=null && !myFile.getFileName().equals(""))
- {
- if(multi.getParameter("oldUrl")!=null && !multi.getParameter("oldUrl").equals(""))
- {
- oldUrl = (String) multi.getParameter("oldUrl");
- SubPathGenerater.deleteFile( root + oldUrl );
- }
- // SubPathGenerater
- attachURL += SubPathGenerater.getSubPath( root + SubPathGenerater.getSeperator() + attachURL);
- myUpload.save( root + attachURL );
- String url = attachURL +SubPathGenerater.getSeperator()+ myFile.getFileName();
- regulationBean.setAttachmentUrl(url);
- }
- else
- {
- if(multi.getParameter("oldUrl")!=null && !multi.getParameter("oldUrl").equals(""))
- {
- oldUrl = (String) multi.getParameter("oldUrl");
- regulationBean.setAttachmentUrl(oldUrl);
- }
- }
- regulationProxy.modifyRegulation(regulationBean);
- response.sendRedirect("/mainctrl/commoninfo/regulation/detailRegulation?regulationId="+regulationId+"&start="+start);
- %>