Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
CHeckstyle and JUnit for base package in ONAP-REST
[policy/engine.git]
/
POLICY-SDK-APP
/
src
/
main
/
java
/
org
/
onap
/
policy
/
controller
/
AdminTabController.java
diff --git
a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AdminTabController.java
b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AdminTabController.java
index
0ab2660
..
139b2b8
100644
(file)
--- a/
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AdminTabController.java
+++ b/
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AdminTabController.java
@@
-26,7
+26,6
@@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
-import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.HashMap;
import java.util.Map;
@@
-53,7
+52,6
@@
import org.springframework.web.servlet.ModelAndView;
public class AdminTabController extends RestrictedBaseController {
private static final Logger LOGGER = FlexLogger.getLogger(AdminTabController.class);
public class AdminTabController extends RestrictedBaseController {
private static final Logger LOGGER = FlexLogger.getLogger(AdminTabController.class);
- private static final String CHARACTER_ENCODING = "UTF-8";
private static CommonClassDao commonClassDao;
private static CommonClassDao commonClassDao;
@@
-108,6
+106,8
@@
public class AdminTabController extends RestrictedBaseController {
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response)
throws IOException {
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response)
throws IOException {
+ response.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING);
+ request.setCharacterEncoding(PolicyUtils.CHARACTER_ENCODING);
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
@@
-123,20
+123,14
@@
public class AdminTabController extends RestrictedBaseController {
globalRole.setRole("super-admin");
commonClassDao.update(globalRole);
globalRole.setRole("super-admin");
commonClassDao.update(globalRole);
- response.setCharacterEncoding(CHARACTER_ENCODING);
- response.setContentType("application / json");
- request.setCharacterEncoding(CHARACTER_ENCODING);
+ response.setContentType(PolicyUtils.APPLICATION_JSON);
String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class));
response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString
+ "}").toString());
String responseString = mapper.writeValueAsString(commonClassDao.getData(GlobalRoleSettings.class));
response.getWriter().write(new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString
+ "}").toString());
-
- return null;
} catch (Exception e) {
LOGGER.error("Exception Occured" + e);
} catch (Exception e) {
LOGGER.error("Exception Occured" + e);
- response.setCharacterEncoding(CHARACTER_ENCODING);
- request.setCharacterEncoding(CHARACTER_ENCODING);
response.getWriter().write(PolicyUtils.CATCH_EXCEPTION);
}
return null;
response.getWriter().write(PolicyUtils.CATCH_EXCEPTION);
}
return null;