BindingResultは、フォームに関連する検証エラーを対象としていることを理解しています。ただし、ビジネスエラーについてはどうでしょうか。たとえば、次のようになります。
public String bulkUpdate(@ModelAttribute form, BindingResult r) {
//do validation, extract selected issues to be bulk updated, etc.
//any form related, binding errors to be put in r
//this part
List<String> results = service.bulkUpdate(issues, newValues);
//where is it appropriate to put the results?
//from experience we just create a request attribute and put it there
request.setAttribute("bulkUpdateErrors", StringUtils.join(results, "<br>"))
//is there an similar generic structure like Errors?
}
そして、jspでは:
<div id='info'>
<c:if test="${not empty bulkUpdateErrors}">
<spring:message code="bulk.update.warning" /> ${bulkUpdateErrors}
</c:if>
</div>
ビジネスエラーを発生させるための同様の一般的な構造はありますか?