|
如图所示:
我先是在数据库里写了个存储过程ExportFile2,将数据库的某个表导出成excel放到服务端。。存储过程我已经单独测试了没有问题。。
然后我在后台写了如下action,改action名字为:daochuMianshi ,后台代码如下:
public static JSONObject daochuMianshi(JSONObject params, ActionContext context) throws SQLException, NamingException, java.sql.SQLException {
Connection conn = context.getConnection("hrSys");
JSONObject rt = new JSONObject();
java.sql.PreparedStatement pstmt = null;
String sql = "exec ExportFile2";
pstmt = conn.prepareStatement(sql);
pstmt.execute();
rt.put("state", "1");
return rt;
}
然后我在前台导出按钮写了如下代码:
justep.Baas.sendRequest({
"url" : "/hrSys/hrSysYw",
"action" : "daochuMianshi",
"async" : false,
"params" : [],
"success" : function(data) {
window.open("http://XXXXX/excel.xls");
}
});
我以前也这样做过,没有问题! 这次不知道为啥就跳出这个错误。。我对比了以前写的,实在没发现哪里不对!!!
|
|