设置网页的http头(下载保存,在线浏览)

类别:Java 点击:0 评论:0 推荐:

<%@ page contentType="text/html; charset=shift_jis" language="java" import="java.sql.*" %>

<%
out.println("fdfafdfdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
response.setHeader("Content-type","application/x-msexcel");
//response.setHeader("Content-Disposition","inline; filename=\"desk.xls\"");//online open
response.setHeader("content-disposition","attachment;filename=\"syntax.xls\"");//download
   %>

本文地址:http://com.8s8s.com/it/it14652.htm