- @RequestMapping(value = { "/sp_dictionary/remove_SafePolicyWarning" }, method = {
- org.springframework.web.bind.annotation.RequestMethod.POST })
- public ModelAndView removeSafePolicyWarningDictionary(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());
- SafePolicyWarning safePolicyWarningData = (SafePolicyWarning) mapper.readValue(root.get("data").toString(),
- SafePolicyWarning.class);
- commonClassDao.delete(safePolicyWarningData);
- response.setCharacterEncoding(utf8);
- response.setContentType(applicationJsonContentType);
- request.setCharacterEncoding(utf8);
-
- PrintWriter out = response.getWriter();
-
- String responseString = mapper.writeValueAsString(commonClassDao.getData(SafePolicyWarning.class));
- JSONObject j = new JSONObject("{groupPolicyScopeListDatas: " + responseString + "}");
- out.write(j.toString());
-
- return null;
- } catch (Exception e) {
- System.out.println(e);
- response.setCharacterEncoding(utf8);
- request.setCharacterEncoding(utf8);
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
+ @RequestMapping(value = { "/sp_dictionary/remove_SafePolicyWarning" }, method = {RequestMethod.POST })
+ public void removeSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.removeData(request, response, safePolicyWarningDatas, SafePolicyWarning.class);