@RequestMapping(value = "/console/app/(*:appId)/(~:version)/form/(*:formId)/update", method = RequestMethod.POST)
public String consoleFormUpdate(@RequestParam(value = "appId") String appId, @RequestParam(value = "version", required = false) String version, @RequestParam(value = "formId") String formId, @RequestParam(value = "json") String json) {
AppDefinition appDef = appService.getAppDefinition(appId, version);
// load existing form definition and update fields
FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);
Form form = (Form) formService.createElementFromJson(json);
formDef.setName(form.getPropertyString("name"));
formDef.setTableName(form.getPropertyString("tableName"));
formDef.setJson(PropertyUtil.propertiesJsonStoreProcessing(formDef.getJson(), json));
// update
formDefinitionDao.update(formDef);
formDataDao.clearFormCache(form);
return "console/apps/dialogClose";