diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-common')
-rw-r--r-- | ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java index 19bec306..f5d37e2b 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java @@ -72,6 +72,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class ProfileSearchController extends RestrictedBaseController { private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ProfileSearchController.class); + + private static final String APPLICATION_JSON = "application/json"; @Autowired private UserProfileService service; @@ -107,7 +109,7 @@ public class ProfileSearchController extends RestrictedBaseController { profileList = service.findAll(); JsonMessage msg = new JsonMessage(mapper.writeValueAsString(profileList)); JSONObject j = new JSONObject(msg); - response.setContentType("application/json"); + response.setContentType(APPLICATION_JSON); response.getWriter().write(j.toString()); } catch (Exception e) { logger.error(EELFLoggerDelegate.applicationLogger, "getUser failed", e); @@ -131,7 +133,7 @@ public class ProfileSearchController extends RestrictedBaseController { model.put("profileList", mapper.writeValueAsString(profileList)); JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); JSONObject j = new JSONObject(msg); - response.setContentType("application/json"); + response.setContentType(APPLICATION_JSON); response.getWriter().write(j.toString()); } catch (Exception e) { logger.error(EELFLoggerDelegate.applicationLogger, "getUserPagination failed", e); @@ -139,7 +141,8 @@ public class ProfileSearchController extends RestrictedBaseController { } @SuppressWarnings("unchecked") - private Map<String, Object> setDashboardData(HttpServletRequest request) throws Exception { + private Map<String, Object> setDashboardData(HttpServletRequest request) + throws com.fasterxml.jackson.core.JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> model = new HashMap<>(); List<List<MenuData>> childItemList = new ArrayList<>(); @@ -170,7 +173,7 @@ public class ProfileSearchController extends RestrictedBaseController { logger.info(EELFLoggerDelegate.auditLogger, "Change active status for user " + user.getId() + " to " + user.getActive()); ObjectMapper mapper = new ObjectMapper(); - response.setContentType("application/json"); + response.setContentType(APPLICATION_JSON); PrintWriter out = response.getWriter(); out.write(mapper.writeValueAsString(user.getActive())); } catch (Exception e) { |