堆栈: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) 我不喜欢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)