@Override protected Object formBackingObject(HttpServletRequest request) throws Exception { // navigation bar active tab request.setAttribute("customerActiveBoolean", true); Conviction conviction; Applicant applicant; String applicantID = request.getParameter("id"); Long l_applicantID = Long.parseLong(applicantID); String convictionString = request.getParameter(LiConstants.CONVICTION_ID); Long convictionId = Long.parseLong(convictionString); if (convictionString != null && convictionString.trim().length() > 0) { convictionId = new Long(convictionString); conviction = getConvictionDetails(convictionId, request); applicant = convictionBusiness.getApplicant(l_applicantID); request.setAttribute("conviction", conviction); } else { logger.error("Could not find an Conviction ID in the request object."); throw new DLSSystemException( "Could not find Conviction Id registered with the name " + LiConstants.CONVICTION_ID + " in the request object.", logger); } if (request.getSession().getAttribute("addConvictionMsg") != null) { request.setAttribute("successMessage", "Conviction added successfully"); request.getSession().removeAttribute("addConvictionMsg"); } request.setAttribute("applicant", applicant); return conviction; }
private Conviction getConvictionDetails(Long convictionId, HttpServletRequest request) { logger.debug( " .......Starting execution of ViewConvictionController.getConvictionDetails()....... "); try { return convictionBusiness.findConvictionById(convictionId); } catch (Exception e) { throw new RuntimeException("Exception while getting Conviction and associations", e); } }