jsp 怎么弹出保存对话框呀 - 扩充话题 / 灌水乐园
如题
js。。
1。可用jsp.SmartUpload ,可到google中搜索下载。
if(fileExists(path)){
SmartUpload su = new SmartUpload();
su.initialize(pageContext);
// 设定contentDisposition为null以禁止浏览器自动打开文件,
//保证点击链接后是下载文件。若不设定,则下载的文件扩展名为
//doc时,浏览器将自动用word打开它。扩展名为pdf时,
//浏览器将用acrobat打开。
su.setContentDisposition(null);
su.downloadFile(path);
}
2。
try{
String filename = request.getParameter("fileName");
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition",
"attachment; filename=“*.*");
java.io.FileInputStream fileInputStream =
new java.io.FileInputStream(filename);
int i;
while ((i=fileInputStream.read()) != -1) {
out.write(i);
}
fileInputStream.close();
out.close();
}catch(Exception e){
e.printStackTrace();
}
我想在客户端,页面,点击一个按钮,然后这时候出现一个保存对话框
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
问题描述:
例如我要显示的内容如下所示
一级目录1
一级目录1子类1
子类1
一级目录1子类2
......
最近一个项目中遇到一个问题:在原有的一套系统中(php开发)添加一些小功能(jsp开发),原来用户系统都是php开发的,我如何在jsp开发的功能中做到用户信息session同步呢? 有人是否有做过类以项目,想听听大家的看法
......
大家好,我在JSP的初学者,在编程中遇到了一个问题:
<jsp:useBean id="accountBiz" class="bank.AccountBiz"
scope="application">
这个标签中application和sessi ......
程序如下:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" %>
<%@ page import="com.mysql.jdbc.Driver" %>
<%@ page import ......