use of org.springframework.web.servlet.ModelAndView in project pinpoint by naver.
the class ScatterChartController method createScatterDataV1.
private ModelAndView createScatterDataV1(ScatterData scatterData, boolean complete) {
ModelAndView mv = new ModelAndView();
mv.addObject("resultFrom", scatterData.getOldestAcceptedTime());
mv.addObject("resultTo", scatterData.getLatestAcceptedTime());
mv.addObject("complete", complete);
mv.addObject("scatter", scatterData);
return mv;
}
use of org.springframework.web.servlet.ModelAndView in project pinpoint by naver.
the class AgentCommandController method createResponse.
private ModelAndView createResponse(boolean success, Object message) {
ModelAndView mv = new ModelAndView();
mv.setViewName("jsonView");
if (success) {
mv.addObject("code", 0);
} else {
mv.addObject("code", -1);
}
mv.addObject("message", message);
return mv;
}
use of org.springframework.web.servlet.ModelAndView in project opennms by OpenNMS.
the class LocationMonitorDetailsController method handle.
@RequestMapping(method = { RequestMethod.GET, RequestMethod.POST })
public ModelAndView handle(HttpServletRequest request, @ModelAttribute("command") LocationMonitorIdCommand cmd, BindingResult errors) {
m_validator.validate(cmd, errors);
LocationMonitorListModel model = null;
if (!errors.hasErrors()) {
model = m_distributedPollerService.getLocationMonitorDetails(cmd, errors);
}
if (errors.hasErrors()) {
return new ModelAndView(ERROR_VIEW);
} else {
ModelAndView modelAndView = new ModelAndView(SUCCESS_VIEW, "model", model);
if (request.isUserInRole(Authentication.ROLE_ADMIN)) {
modelAndView.addObject("isAdmin", "true");
}
return modelAndView;
}
}
use of org.springframework.web.servlet.ModelAndView in project opennms by OpenNMS.
the class ServiceController method createErrorModelAndView.
private ModelAndView createErrorModelAndView(int node, String intf, int serviceId) {
ModelAndView modelAndView = new ModelAndView("element/errorPageService");
modelAndView.addObject("node", node);
modelAndView.addObject("intf", intf);
modelAndView.addObject("serviceId", serviceId);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project opennms by OpenNMS.
the class AlarmDetailController method saveStickyMemo.
public ModelAndView saveStickyMemo(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
int alarmId;
String alarmIdString = "";
// Try to parse alarm ID from string to integer
try {
alarmIdString = httpServletRequest.getParameter("alarmId");
alarmId = Integer.parseInt(alarmIdString);
String stickyMemoBody = httpServletRequest.getParameter("stickyMemoBody");
m_webAlarmRepository.updateStickyMemo(alarmId, stickyMemoBody, httpServletRequest.getRemoteUser());
return new ModelAndView(new RedirectView("detail.htm", true), "id", alarmId);
} catch (NumberFormatException e) {
logger.error("Could not parse alarm ID '{}' to integer.", httpServletRequest.getParameter("alarmId"));
throw new ServletException("Could not parse alarm ID " + httpServletRequest.getParameter("alarmId") + " to integer.");
}
}
Aggregations