发布网友 发布时间:2022-04-22 21:02
共2个回答
热心网友 时间:2023-07-31 14:09
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>文件下载</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">
-->
<script language="JavaScript">
function refush(obj){
//只有这样才能实现刷新直接onclick="this.src='/validatecode.do?'+Math.random()"
//是无法刷新的,图片一把X
obj.src='<%=request.getContextPath()%>/validatecode.do?'+Math.random();
}
</script>
</head>
<body>
文件列表:<br>
<a href="download.do?path=upload/123.txt">1.txt</a><br>
<a href="download.do?path=upload/你好.txt">你好.txt</a><br>
<a href="download.do?path=upload/aoto.JPG">aoto.jpg</a><br>
<a href="download.do?path=upload/Word 培训文档.docx">word培训文档</a>
<form action="" name="frm" method="post">
<input type="text" name="validateCode" alt="请输入此验证码" />
<html:img page="/validatecode.do" paramName="imgValidate" border="0"
onclick="refush(this);" alt="请输入此验证码,如看不清请点击刷新。"
style="cursor:pointer" />
</form>
</body>
</html>
热心网友 时间:2023-07-31 14:09
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";