}
public ActionForward createCreditNote(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
final CreateCreditNoteBean createCreditNoteBean =
(CreateCreditNoteBean) RenderUtils.getViewState("create-credit-note").getMetaObject().getObject();
try {
CreateCreditNote.run(getUserView(request).getPerson(), createCreditNoteBean);
} catch (DomainExceptionWithLabelFormatter ex) {
addActionMessage(request, ex.getKey(), solveLabelFormatterArgs(request, ex.getLabelFormatterArgs()));
request.setAttribute("createCreditNoteBean", createCreditNoteBean);
return mapping.findForward("create");
} catch (DomainException ex) {
addActionMessage(request, ex.getKey());
request.setAttribute("createCreditNoteBean", createCreditNoteBean);
return mapping.findForward("create");
}
request.setAttribute("receipt", createCreditNoteBean.getReceipt());
return mapping.findForward("list");
}