?? upload.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ghy.bookstore.load.model.FileLinkVO"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String message=request.getParameter("message");
ArrayList list=(ArrayList)session.getAttribute("fileLink");
FileLinkVO filelink =new FileLinkVO();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'upload.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<table width="400" border="1" align="center">
<tbody><tr>
<td>文件上傳</td></tr>
<tr>
<td>注意事項:上傳格式為"jpg","jpeg","gif", "txt","doc","docx","mp3","wma","m4a"文件大小不超過3M.<br></td></tr>
<tr>
<td>
<form action="<%=path%>/load/upload" method="post"
enctype="multipart/form-data">
<input type="file" size="30" name="test" />
<br />
<input name="up" type="submit" value="上傳" />
</form>
</td></tr><tr><td valign="top">
<%
if(message!=null)
{
上傳失敗:
%>
<%=message %>
<%
}
%>
<br></td></tr>
</tbody></table>
<table width="400" border="1" align="center"><tbody><tr><td> 資源</td><td> 操作</td></tr>
<%
if(list!=null)
{
for(int i=0;i<list.size();i++)
{
filelink=(FileLinkVO)list.get(i);
%>
<tr>
<td><%=filelink.getFilename()%></td>
<td><a href="<%=path+"/load/download?id="+filelink.getId()%>"/>刪除</td></tr>
<%
}
}
%></tbody></table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -