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

📄 upload.jsp

📁 servlet实现网上书店查询
💻 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>注意事项:上传格式为&quot;jpg&quot;,&quot;jpeg&quot;,&quot;gif&quot;, &quot;txt&quot;,&quot;doc&quot;,&quot;docx&quot;,&quot;mp3&quot;,&quot;wma&quot;,&quot;m4a&quot;文件大小不超过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>&nbsp;资源</td><td>&nbsp;操作</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 + -