private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MenuListController.class);
+ private static final String APPLICATION_JSON = "application/json";
+
@Autowired
private FnMenuService fnMenuService;
@Autowired
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(parentList),
mapper.writeValueAsString(childItemList), userName);
JSONObject j = new JSONObject(msg);
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
response.getWriter().write(j.toString());
logger.debug(EELFLoggerDelegate.debugLogger, "getMenu ends");
} catch (Exception e) {
try {
String appName = (String) session
.getAttribute(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME));
- if (appName != null && appName.equals("app_display_name")) {
+ if (appName != null && "app_display_name".equals(appName)) {
appName = "";
}
JsonMessage msg = new JsonMessage(appName);
JSONObject j = new JSONObject(msg);
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
response.getWriter().write(j.toString());
logger.debug(EELFLoggerDelegate.debugLogger, "getAppName ends");
} catch (Exception e) {
String contextId = null;
if (request.getCookies() != null) {
for (Cookie ck : request.getCookies()) {
- if (ck.getName().equalsIgnoreCase("EPService"))
+ if ("EPService".equalsIgnoreCase(ck.getName()))
contextId = ck.getValue();
}
}
model.put(sharedContext.getCkey(), sharedContext.getCvalue());
}
JSONObject j = new JSONObject(model);
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
response.getWriter().write(j.toString());
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "getUserInfo failed", e);
isAppCentralized = true;
map.put("isAppCentralized", Boolean.toString(isAppCentralized));
JSONObject j = new JSONObject(map);
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
response.getWriter().write(j.toString());
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "Failed to serialize JSON", e);