小编den*_*a08的帖子

为什么会出现这个错误?已建立的连接被主机中的软件中止

堆栈:AngularJS v1.6.5、java 8、spring boot、tomcat。经过大约 1 周的工作,应用程序没有响应此类错误。为什么会发生这种情况?

前端

$http({
             url: 'find',
             method: "post",
             data: { 'month' : $scope.month,'year' : $scope.year, 'payTime' : $scope.payTime,'waitTime' : $scope.waitTime,'scanTime' : $scope.scanTime,'gbNumber' : $scope.hyper}
         })
         .then(function(response) {
 ..
       });
 }
Run Code Online (Sandbox Code Playgroud)

后端

@RequestMapping(path = "/find", method = RequestMethod.POST)
public ReportResponse find(@RequestBody RequestSearch params,
                           HttpServletResponse response) throws DataNotFoundException {
  ...

}
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪

2018-04-02 09:37:44.738 ERROR 14912 --- [p-nio-80-exec-9] o.s.boot.web.support.ErrorPageFilter     : Cannot forward to error page for request [/excel/ExceReport.xls] as the response has already been committed. …
Run Code Online (Sandbox Code Playgroud)

java angularjs

9
推荐指数
1
解决办法
2万
查看次数

如何使用lambda更好地做到这一点?

我不喜欢forEach的部分,但我不知道如何用lambda做得更好.

list1.stream().map(element -> {
    list2.forEach(item -> {
       if (element.getKey().equals(item.getKeyNextYear())) {
          element.setSummPreviosYear(item.getSumm());
          element.setCashboxCountPreviosYear(item.getCashboxCount());
          element.setCheckCountPreviosYear(item.getCheckCount());
          element.setArticleCountPreviosYear(item.getArticleCount());
       }
    });
    return element;
}).collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)

java java-8

2
推荐指数
1
解决办法
116
查看次数

标签 统计

java ×2

angularjs ×1

java-8 ×1