file.jsp
资源名称:(J2EE)oa.rar [点击查看]
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:3k
源码类别:
Jsp/Servlet
开发平台:
Java
- <%@ page language="java" pageEncoding="GBK"%>
- <%@ page import="java.util.ArrayList"%>
- <%@ page import="java.util.List"%>
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
- <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
- <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
- <script>
- function moveto(fileid){
- var select = document.getElementById("userforder"+fileid);
- if(select.value=='移动到'){
- return false;
- }
- var forderid = document.getElementById("forderid").value;
- if(select.value==forderid){
- alert("文件已经在本目录下了");
- return false;
- }
- location.href="${pageContext.request.contextPath}/userFile.do?method=moveto&forderid="+forderid+"&fileid="+fileid+"&movetofiledid="+select.value;
- }
- function go(){
- location.href="${pageContext.request.contextPath}/folder.do?method=myFolder";
- }
- </script>
- </head>
- <body>
- <html:form action="/userFile" method="post" enctype="multipart/form-data" >
- <html:hidden property="method" value="uploadfile"/>
- <html:hidden property="forderid"/>
- <table width="100%" border="1">
- <tr>
- <td align="center">文件</td>
- <td align="center">上传时间</td>
- <td align="center">大小(b)</td>
- <td align="center">操作</td>
- </tr>
- <logic:notPresent name="myfileList">
- <tr>
- <td colspan="4">暂时没有数据</td>
- </tr>
- </logic:notPresent>
- <logic:present name="myfileList">
- <logic:empty name="myfileList">
- <tr>
- <td colspan="4">暂时没有数据</td>
- </tr>
- </logic:empty>
- <logic:notEmpty name="myfileList">
- <logic:iterate id="temp" name="myfileList">
- <tr>
- <td align="center">
- <html:link page="/downLoadServlet?filename=${temp.filename}&filepath=${temp.realpath}">
- <bean:write name="temp" property="filename"/>
- </html:link>
- </td>
- <td align="center">
- <bean:write name="temp" property="addtime"/>
- </td>
- <td align="center">
- <bean:write name="temp" property="filesize"/>
- </td>
- <td align="center">
- <html:link action="/userFile.do?method=delfile&fileid=${temp.fileid}" onclick="return confirm('你确定删除吗?');">删除</html:link>
-
- <select id="userforder${temp.fileid}" onchange="return moveto(${temp.fileid});">
- <option value="移动到">移动到</option>
- <logic:notEmpty name="userforderList" >
- <logic:iterate id="forder" name="userforderList">
- <option value="${forder.forder}">${forder.virtualfordername}</option>
- </logic:iterate>
- </logic:notEmpty>
- </select>
- </td>
- </tr>
- </logic:iterate>
- </logic:notEmpty>
- </logic:present>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- <tr>
- <td colspan="4">
- <html:file property="formfile">
- </html:file>
- <input type="submit" value="上传文件" />
- <input type="button" value="返回文件夹" onclick="go();"/>
- </td>
- </tr>
- </table>
- </html:form>
- </body>
- </html>