- @RequestMapping(value={"/action_dictionary/remove_actionPolicyDict"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
- try{
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- ActionPolicyDict actionPolicyDict = (ActionPolicyDict)mapper.readValue(root.get("data").toString(), ActionPolicyDict.class);
- commonClassDao.delete(actionPolicyDict);
- response.setCharacterEncoding(utf8);
- response.setContentType("application / json");
- request.setCharacterEncoding(utf8);
-
- PrintWriter out = response.getWriter();
-
- String responseString = mapper.writeValueAsString(ActionPolicyDictionaryController.commonClassDao.getData(ActionPolicyDict.class));
- JSONObject j = new JSONObject("{actionPolicyDictionaryDatas: " + responseString + "}");
- out.write(j.toString());
-
- return null;
- }
- catch (Exception e){
- LOGGER.error(e);
- response.setCharacterEncoding(utf8);
- request.setCharacterEncoding(utf8);
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
+ @RequestMapping(value={"/action_dictionary/remove_actionPolicyDict"}, method={RequestMethod.POST})
+ public void removeActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.removeData(request, response, actionDatas, ActionPolicyDict.class);