页面是jsp做的,后台的controller如下所示,为什么我点击前端还是实现不了下载呢?
@RequestMapping(value = "regionInfoDload",method = RequestMethod.GET)
public void infoDownLoad(Integer regionLevel, HttpServletRequest request, HttpServletResponse response, Model model) {
System.out.println("从前台获得的regionLevel: " + regionLevel);
List<TljsjkAjlj15> listTest = tljsjkAjlj15Service.conditionDownload(regionLevel, null,null);
System.out.println("测试下载查询的数据总量: " + listTest.size());
//1.创建excel的文档对象
HSSFWorkbook wb = new HSSFWorkbook();
//2.创建excel的表单
HSSFSheet sheet = wb.createSheet("性别");
//设置行的高度
//sheet.setColumnWidth(i, 256*18);
//3.excel字体
HSSFFont font = wb.createFont();
//4.excel样式
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HSSFCellStyle.ALIGN_CENTER); //水平居中对齐
HSSFRow row = sheet.createRow(1);
HSSFCell cell = row.createCell(1);
cell.setCellValue("姓名");
cell = row.createCell(2);
cell.setCellValue("身高预测值");
System.out.println("======================100================");
for(int i =2;i<listTest.size() + 1;i++) {
row = sheet.createRow(i);
cell = row.createCell(1);
cell.setCellValue(listTest.get(i - 2).getJh() == null ? "":listTest.get(i - 2).getJh());
cell = row.createCell(2);
cell.setCellValue(listTest.get(i - 2).getYlmbqYc() == null ? 0: listTest.get(i - 2).getYlmbqYc());
}从前端发送请求,controller中的的代码执行到:System.out.println("======================400================");这一句,为什么还是实现不了?
大家知道我出错了在哪里吗?抑或大家有什么别的解决方案吗?望请各位路过的大咖不吝赐教。跪谢!
拉莫斯之舞
偶然的你
开满天机
相关分类