file.jsp
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page language="java" pageEncoding="GBK"%>
  2. <%@ page import="java.util.ArrayList"%>
  3. <%@ page import="java.util.List"%>
  4. <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
  5. <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
  6. <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
  7. <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
  8. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
  12. <script>
  13. function moveto(fileid){
  14. var select = document.getElementById("userforder"+fileid);
  15. if(select.value=='移动到'){
  16. return false;
  17. }
  18. var forderid = document.getElementById("forderid").value;
  19. if(select.value==forderid){
  20. alert("文件已经在本目录下了");
  21. return false;
  22. }
  23. location.href="${pageContext.request.contextPath}/userFile.do?method=moveto&forderid="+forderid+"&fileid="+fileid+"&movetofiledid="+select.value;
  24. }
  25. function go(){
  26. location.href="${pageContext.request.contextPath}/folder.do?method=myFolder";
  27. }
  28. </script>
  29. </head>
  30. <body>
  31. <html:form action="/userFile" method="post" enctype="multipart/form-data" >
  32. <html:hidden property="method" value="uploadfile"/>
  33. <html:hidden property="forderid"/>
  34. <table width="100%" border="1">
  35.   <tr>
  36.     <td align="center">文件</td>
  37.     <td align="center">上传时间</td>
  38.     <td align="center">大小(b)</td>
  39.     <td align="center">操作</td>
  40.   </tr>
  41.   
  42.   <logic:notPresent name="myfileList">
  43.    <tr>
  44.    <td colspan="4">暂时没有数据</td>
  45.    </tr>
  46.   </logic:notPresent>
  47.   <logic:present name="myfileList">
  48.    <logic:empty name="myfileList">
  49.    <tr>
  50.    <td colspan="4">暂时没有数据</td>
  51.    </tr>
  52.    </logic:empty>
  53.    <logic:notEmpty name="myfileList">
  54.    <logic:iterate id="temp" name="myfileList">
  55.   
  56.    <tr>
  57.     <td align="center">
  58.     <html:link page="/downLoadServlet?filename=${temp.filename}&filepath=${temp.realpath}">
  59.      <bean:write name="temp" property="filename"/>
  60.     </html:link>
  61.     </td>
  62.     <td align="center">
  63.      <bean:write name="temp" property="addtime"/>
  64.     </td>
  65.     <td align="center">
  66.      <bean:write name="temp" property="filesize"/>
  67.     </td>
  68.     <td align="center">
  69. <html:link action="/userFile.do?method=delfile&fileid=${temp.fileid}" onclick="return confirm('你确定删除吗?');">删除</html:link>
  70. &nbsp;&nbsp;&nbsp;&nbsp;
  71. <select id="userforder${temp.fileid}" onchange="return moveto(${temp.fileid});">
  72. <option value="移动到">移动到</option>
  73. <logic:notEmpty name="userforderList" >
  74. <logic:iterate id="forder" name="userforderList">
  75. <option value="${forder.forder}">${forder.virtualfordername}</option>
  76. </logic:iterate>
  77. </logic:notEmpty>
  78. </select>
  79. </td>
  80.  </tr>
  81.    </logic:iterate>
  82.    </logic:notEmpty>
  83.   </logic:present>
  84.   
  85.   <tr>
  86.     <td>&nbsp;</td>
  87.     <td>&nbsp;</td>
  88.     <td>&nbsp;</td>
  89.     <td>&nbsp;</td>
  90.   </tr>
  91.   <tr>
  92.     <td>&nbsp;</td>
  93.     <td>&nbsp;</td>
  94.     <td>&nbsp;</td>
  95.     <td>&nbsp;</td>
  96.   </tr>
  97.   <tr>
  98.     <td colspan="4">
  99. <html:file property="formfile">
  100. </html:file>
  101. <input type="submit" value="上传文件" />
  102. <input type="button" value="返回文件夹" onclick="go();"/>
  103. </td>
  104.   </tr>
  105. </table>
  106. </html:form>
  107. </body>
  108. </html>