⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file_view.jsp

📁 Java开发的权限管理的例子
💻 JSP
字号:
<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/jsp/common.jsp"%>
<%@page import="com.gsta.eshore.framework.util.EnvironmentConfig"%>
<%@page import="com.gsta.eshore.framework.util.FileConfig"%>
<%@page import="java.io.File"%>
<%@page import="java.sql.Timestamp"%>
<html>
<head>
<title>文件上传</title>
<link title=Style href="../../common/css/style.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function download(fname){
     alert(sfsfs);
	 alert(name);
	 document.downloadForm.imageid.value=name;
	 document.downloadForm.filename.value=fname;
	  alert(document.downloadForm.imageid.value);
     document.downloadForm.action="../../member/file/FileDownload.do?myaction=download";  
     document.downloadForm.submit(); 
     return true;
}  

  function confirmDelete()
	{
	    return con = confirm("确定要删除吗?");
	}
//-->
</script>
</head>
<body>
<div align="center"><span class="title1">上传的文件列表</span><br>
</div>
<center>

                <html:form action="/member/file/FileDownload.do?myaction=download">
                 <table width="567" class="tableBorder">
                 <tr>
                    <td width="180" class="forumRow">文件名</td>
                    <td width="180" class="forumRow">时间</td>
                    <td width="30" class="forumRow">下载</td>
                    <td width="40" class="forumRow">删除</td>
                   </tr>
                <%
                 	      String filePath = EnvironmentConfig.getInstance().getPropertyValue(
					                 FileConfig.ConfigFile, "upLoadPath");
			                 System.out.println("filePath = "+filePath);
			                 File dir = new File(filePath);
			                 File[] files=null;
			                 if(dir.isDirectory()){
			                 files=dir.listFiles();
			                 }
			                 if(files!=null){
			                 for(int i=0;i<files.length;i++){
			                 
			                 
                  %>
                  <tr >
                    <td class="forumRow"><%=files[i].getName() %></td>
                    <td class="forumRow"><%=new Timestamp(files[i].lastModified())%></td>
                    <td class="forumRow">
                    <a href="<%=request.getContextPath()%>/servlet/DownloadFileServlet?filename=<%=java.net.URLEncoder.encode(files[i].getName(),"UTF-8") %>">下载</a>

                       </td>
                    <td class="forumRow">
                    <a href="<%=request.getContextPath()%>/member/file/FileDelete.do?myaction=delete&filename=<%=filePath+java.net.URLEncoder.encode(files[i].getName(),"UTF-8") %>">删除</a>
                   
                   </tr>
 		      <%} }%>
                </table>
                </html:form>   
</center>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -