@RequestMapping(value={"/",""},method=RequestMethod.POST) @ResponseBody public RestWrapper update(@ModelAttribute("propertiesTemplate") @Valid PropertiesTemplate propertiesTemplate,BindingResult bindingResult,Principal principal){
  RestWrapper restWrapper=null;
  if (bindingResult.hasErrors()) {
    BindingResultError bindingResultError=new BindingResultError();
    return bindingResultError.errorMessage(bindingResult);
  }
  try {
    PropertiesTemplate propertiesTemplateUpdate=propertiesTemplateDAO.updateProcessTemplate(propertiesTemplate);
    restWrapper=new RestWrapper(propertiesTemplateUpdate,RestWrapper.OK);
    LOGGER.info("Record with ID:" + propertiesTemplateUpdate.getProcessTemplateId() + " updated in PropertiesTemplate by User:"+ principal.getName()+ propertiesTemplateUpdate);
  }
 catch (  Exception e) {
    LOGGER.error(e);
    restWrapper=new RestWrapper(e.getMessage(),RestWrapper.ERROR);
  }
  return restWrapper;
}

@ RequestMapping ( value = { "/" , "" } , method = RequestMethod . POST ) @ ResponseBody public RestWrapper update ( @ ModelAttribute ( "propertiesTemplate" ) @ Valid PropertiesTemplate propertiesTemplate , BindingResult bindingResult , Principal principal ) { RestWrapper restWrapper = null ; if ( bindingResult . hasErrors ( ) ) { BindingResultError bindingResultError = new BindingResultError ( ) ; return bindingResultError . errorMessage ( bindingResult ) ; } try { PropertiesTemplate propertiesTemplateUpdate = propertiesTemplateDAO . updateProcessTemplate ( propertiesTemplate ) ; restWrapper = new RestWrapper ( propertiesTemplateUpdate , RestWrapper . OK ) ; LOGGER . info ( "Record with ID:" + propertiesTemplateUpdate . getProcessTemplateId ( ) + " updated in PropertiesTemplate by User:" + principal . getName ( ) + propertiesTemplateUpdate ) ; } catch ( Exception e ) { LOGGER . error ( e ) ; restWrapper = new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
this method calls proc updateproperties and updates the values passed . it also validates the values passed .
