你好,波总:
试着用JFinal 做个模型,在Controll中进行文件下载,为什么方法执行2遍?
public void test(){
String cityName="全省";
String cityInst=getPara("cityInst");
System.out.println("haaaaaaaaaaaaaaaaaaaaaaaaaa!");
String path = RptCstmIncomeController.class.getClassLoader().getResource("").getFile()
+ "cstmserv/";
String xlsFilePath=path.substring(0,path.indexOf("WEB-INF"))+"cstm_report/excelFile/";
String report_temp = path + "RptCstmIncome.xls";
///renderText("hahaha!");
renderFile(new File(report_temp));
}
打印:
haaaaaaaaaaaaaaaaaaaaaaaaaa!
JFinal action report -------- 2017-04-01 16:50:17 ------------------------------
Controller : cstmserv.RptCstmIncomeController.(RptCstmIncomeController.java:1)
Method : test
Interceptor : jfinal.AuthInterceptor.(AuthInterceptor.java:1)
Parameter : busi_id= cityInst= counInst= reg_date=2017-04
--------------------------------------------------------------------------------
haaaaaaaaaaaaaaaaaaaaaaaaaa!
JFinal action report -------- 2017-04-01 16:50:17 ------------------------------
Controller : cstmserv.RptCstmIncomeController.(RptCstmIncomeController.java:1)
Method : test
Interceptor : jfinal.AuthInterceptor.(AuthInterceptor.java:1)
Parameter : busi_id= cityInst= counInst= reg_date=2017-04
--------------------------------------------------------------------------------
1:页面中有某个资源的 src 值为空串,例如 src=""
2:只出现过一次,具体原因忘记了
其中第一个是出现最多次的,要格外关注。可以肯定的是:这种情况与 jfinal 自身毫无关系,细心地对程序多调试几次就能解决