ssm展示HDFS文件列表,上传文件,删除文件,下载文件前端代码
时间: 2023-06-13 21:05:03 浏览: 124
1. 展示HDFS文件列表前端代码:
```
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HDFS文件列表</title>
</head>
<body>
<h3>HDFS文件列表</h3>
<table>
<tr>
<th>文件名</th>
<th>文件大小</th>
<th>修改时间</th>
<th>操作</th>
</tr>
<c:forEach items="${fileList}" var="file">
<tr>
<td>${file.fileName}</td>
<td>${file.fileSize}</td>
<td>${file.modifiedTime}</td>
<td>
<a href="downloadFile?filePath=${file.filePath}">下载</a>
<a href="deleteFile?filePath=${file.filePath}">删除</a>
</td>
</tr>
</c:forEach>
</table>
<br>
<form action="uploadFile" method="POST" enctype="multipart/form-data">
<label for="file">选择文件:</label>
<input type="file" name="file" id="file">
<input type="submit" value="上传">
</form>
</body>
</html>
```
2. 上传文件前端代码:
```
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>上传文件</title>
</head>
<body>
<h3>上传文件</h3>
<form action="uploadFile" method="POST" enctype="multipart/form-data">
<label for="file">选择文件:</label>
<input type="file" name="file" id="file">
<input type="submit" value="上传">
</form>
<br>
<a href="listFiles">返回文件列表</a>
</body>
</html>
```
3. 删除文件前端代码:
```
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>删除文件</title>
</head>
<body>
<h3>删除文件</h3>
<form action="deleteFile" method="POST">
<label for="filePath">文件路径:</label>
<input type="text" name="filePath" id="filePath">
<input type="submit" value="删除">
</form>
<br>
<a href="listFiles">返回文件列表</a>
</body>
</html>
```
4. 下载文件前端代码:
```
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>下载文件</title>
</head>
<body>
<h3>下载文件</h3>
<form action="downloadFile" method="POST">
<label for="filePath">文件路径:</label>
<input type="text" name="filePath" id="filePath">
<input type="submit" value="下载">
</form>
<br>
<a href="listFiles">返回文件列表</a>
</body>
</html>
```
阅读全文