?? downmp3list.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ include file="pack.jsp" %>
<%
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>My JSP 'DownMp3List.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>
<%
Mp3Bo m=new Mp3Bo();
String fileName="購物清單_"+m.getTime();
//先把中文轉化成字節數組
byte[] buff = fileName.getBytes("gb2312");
//iso-8859-1形式的字符串
fileName = new String(buff,"iso-8859-1");
response.setContentType("application/vnd.ms-excel;charset=gb2312");
response.setHeader("Content-Disposition", "attachment;filename="+fileName+".xls");
request.getRequestDispatcher("List.jsp").include(request, response);
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -