protected Object formBackingObject(HttpServletRequest request) throws Exception {
    Applicant applicant = (Applicant) request.getAttribute("applicant");
    if (applicant == null) {
      // TODO: applicant =
      // ApplicantDao.getApplicant(request.getAttribute("personId"));

      HttpSession session = request.getSession();

      String applicantId = (String) session.getAttribute(DLRConstants.SESSION_APPLICANT_ID);
      if (!(applicantId == null)) {
        applicant = applicantBus.findByIdBasicInfoAndAkas(Long.valueOf(applicantId));
      }
      // null session reference
      session = null;
    }

    NDLSUser ndlsUser = (NDLSUser) request.getSession().getAttribute(DLRConstants.NDLS_USER);

    InitiatePDPSU1InquiryBean pdpsBean =
        PDPSClientBusiness.populatePDPSNewDriverBean(applicant, ndlsUser);

    if (applicant != null) {
      request.setAttribute("enabledFlag", "true");
    } else {
      request.setAttribute("enabledFlag", "false");
    }
    return pdpsBean;
  }
 public synchronized void addMessage(MessageBaseImpl message) {
   super.addMessage(message);
   if (!isPersisted() && "CG".equals(message.getMessageType())) {
     try {
       IMessageBusiness dbMessageBusiness = MessageDAOFactory.getDBMessageBusiness();
       updateTransaction(MessageCodeConstants.CSOR_IN_PROGRESS);
       TransactionMessageImpl txMessage =
           dbMessageBusiness.loadTransactionMessage(
               messageId, MessageCodeConstants.OUTGOING, false);
       ApplicantBusiness appBusiness =
           (ApplicantBusiness) MessageDAOFactory.getAppBeanInstance("applicantBusiness");
       Applicant applicant = appBusiness.findBaseAppById(txMessage.getPersonId());
       applicant.setCsorIndicator(new Boolean(true));
       appBusiness.saveOrUpdate(applicant);
     } catch (HibernateException he) {
       AAMVALogger.error(message.getMessageId(), this.getClass(), he.getMessage());
       throw he;
     }
   }
 }
  protected ModelAndView onSubmit(
      HttpServletRequest request,
      HttpServletResponse response,
      Object command,
      BindException errors) {

    InitiatePDPSU1InquiryBean createPDPSBean = (InitiatePDPSU1InquiryBean) command;

    HttpSession session = request.getSession();

    String applicantId = (String) session.getAttribute(DLRConstants.SESSION_APPLICANT_ID);
    Long personId = Long.valueOf(applicantId);

    String msgId = null;

    try {
      msgId =
          PDPSService.performCreatePDPSDriverRequest(createPDPSBean.toParametersMap(), personId);
      if (!StringUtil.trimString(msgId).equals("")) {
        applicantBus.updatePDPSPersonStatus(
            personId, MessageCodeConstants.PDPS_PERSON_STATUS_ADD_DRIVER_INITIATED);
      }

    } catch (ValidationException e) {
      ArrayList<Object> errorsList = e.getErrors();
      return new ModelAndView(getErrorView(), "errorsList", errorsList);
    } catch (MessageException e) {
      ArrayList<Object> errorsList = new ArrayList<Object>();
      errorsList.add(e.getMessage());
      return new ModelAndView(getErrorView(), "errorsList", errorsList);
    }

    HashMap<Object, Object> map = new HashMap<Object, Object>();
    map.put("messageid", msgId);
    map.put("uscName", "Create New Driver on PDPS");

    return new ModelAndView("aamva/common/messageSent", map);
  }