不报错,不显示,也不弹出下载对话框
在网上参考了很多例子,
extjs 代码如下:
xtype:'button',
text : "下载",
height:25,
cls :'update_btn',
iconCls : "client_updateIcon",
listeners:{
"click":function(){
window.open("orgIncome_getPdf.action?fileName=first.pdf");
}
}
java 后台代码如下:
public InputStream getPdf() {
System.out.println(ServletActionContext.getServletContext()
.getRealPath("/")
+ fileName);
return ServletActionContext.getServletContext().getResourceAsStream(
ServletActionContext.getServletContext().getRealPath("/")
+ fileName);
}
在网上参考了很多例子,
extjs 代码如下:
xtype:'button',
text : "下载",
height:25,
cls :'update_btn',
iconCls : "client_updateIcon",
listeners:{
"click":function(){
window.open("orgIncome_getPdf.action?fileName=first.pdf");
}
}
java 后台代码如下:
public InputStream getPdf() {
System.out.println(ServletActionContext.getServletContext()
.getRealPath("/")
+ fileName);
return ServletActionContext.getServletContext().getResourceAsStream(
ServletActionContext.getServletContext().getRealPath("/")
+ fileName);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货