List of usage examples for org.springframework.web.servlet ModelAndView addObject
public ModelAndView addObject(String attributeName, @Nullable Object attributeValue)
From source file:jahspotify.web.ui.HistoryBrowswerUIController.java
@RequestMapping(value = "/trackhistory/{queueTrackLink}") public ModelAndView trackHistoryDetail(@PathVariable(value = "queueTrackLink") String queueTrackLink) { final Link link = Link.create(queueTrackLink); final TrackHistory trackHistory = _historicalStorage.getHistory(link); final TrackStatistics trackStatistics = _historicalStorage.getTrackStatistics(trackHistory.getTrackLink()); final ModelAndView modelAndView = new ModelAndView("/jsp/track-history-detail.jsp"); modelAndView.addObject("trackStatistics", trackStatistics); return modelAndView; }
From source file:kievreclama.task.controllers.PostController.java
@RequestMapping(value = "add") public ModelAndView getPageFormDeparmentAdd() { ModelAndView model = new ModelAndView("form-post-add", NAME_MODEL, new PostModel()); model.addObject("HEFT_POST", HEFT_POST); return model; }
From source file:org.ala.spatial.services.web.ApplicationController.java
@RequestMapping(value = APP_VIEW) public ModelAndView appInfo(@PathVariable String appid) { Application app = applicationDao.findApplicationByAppId(appid); ModelAndView m = new ModelAndView("apps/view"); m.addObject("app", app); return m;// w w w . j a v a2s . c om }
From source file:org.statefulj.webapp.controller.AccountController.java
@Transition(event = ACCOUNT_DISPLAY_EVENT) @PreAuthorize("#account.owner.email == principal.username") public ModelAndView displayAccount(Account account, String event) { ModelAndView mv = new ModelAndView("account"); mv.addObject("account", account); return mv;//from w ww .j av a 2 s .com }
From source file:br.com.joaops.smt.controller.SystemModuleController.java
@RequestMapping(value = "/add", method = RequestMethod.GET) public ModelAndView add(HttpServletRequest request, HttpServletResponse response) { ModelAndView mav = new ModelAndView("/system/module/add"); mav.addObject("module", systemModuleService.newSystemModule()); return mav;/* w w w . jav a2 s. c o m*/ }
From source file:br.com.projetotcc.controller.DesenvolvedorController.java
@RequestMapping("/desenvolvedor") public ModelAndView desenvolvedor() { ModelAndView model = new ModelAndView("desenvolvedor"); model.addObject("areas", areaDao.list()); return model; }
From source file:edu.wisc.doit.tcrypt.controller.CreateController.java
@ExceptionHandler(ValidationException.class) public ModelAndView handleException(ValidationException e) throws Exception { ModelAndView mav = createServiceKeyInit(); mav.addObject("errorMessage", e.getMessage()); return mav;/*from w w w . j a v a 2 s . com*/ }
From source file:net.mindengine.oculus.frontend.web.controllers.user.ForgotPasswordController.java
@Override protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { ForgotPasswordData data = (ForgotPasswordData) command; User user = userDAO.getUserByEmail(data.getEmail()); if (user != null) { String msg = ""; msg += "Your account is:\n"; msg += "Login: " + user.getLogin() + "\n"; msg += "Password: " + user.getPassword(); MailUtils.postMail(config.getMailSmtpHost(), config.getMailSmtpPort(), new String[] { user.getEmail() }, "Oculus Password Recovery", msg, config.getMailSenderName()); ModelAndView mav = new ModelAndView(getSuccessView()); mav.addObject("forgotPasswordEmail", data.getEmail()); return mav; } else {//from w w w . j ava 2 s. c o m ModelAndView mav = new ModelAndView(getFailedView()); mav.addObject("forgotPassword", data); mav.addObject("errorMessage", "User with email '" + data.getEmail() + "' doesn't exist in DB"); return mav; } }
From source file:org.ff4j.console.controller.AbstractConsoleController.java
/** * Process error//from w w w . jav a2 s .c o m * @param e * target error * @return * target pb. */ @ExceptionHandler(Exception.class) public ModelAndView handleException(final Exception e, HttpServletRequest request) { // Clear Session request.getSession().removeAttribute(ATTR_ENVBEAN); final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); ModelAndView mav = new ModelAndView("error"); mav.addObject("errorMsg", e.getMessage()); mav.addObject("errorStack", sw.toString().replaceAll("\\n", "<br>")); return mav; }
From source file:org.ff4j.console.controller.StatsController.java
/** * Display screen//from www .j av a 2 s.c om */ @RequestMapping(method = RequestMethod.GET) public ModelAndView showPage(HttpServletRequest req, HttpServletResponse res, @RequestParam(value = "uid", required = false) String uid) throws Exception { // Environment de travail EnvironmenBean envBean = (EnvironmenBean) req.getSession().getAttribute(ATTR_ENVBEAN); if (null == envBean) { return new ModelAndView("redirect:loadConfig.do"); } log.info("Page <MONITORING>, action<GET>, env<" + envBean.getEnvId() + ">"); // Display all if ("ALL".equals(uid)) uid = null; // Invoke Monitoring resource ConsoleHttpClient client = new ConsoleHttpClient(getConnection(envBean.getEnvId())); StatisticsBean statisticBean = client.getStatisticBean(uid); // Access features through HTTP store (all parsing done) FeatureStore storeHTTP = new FeatureStoreHttp(envBean.getEnvUrl() + "/" + FF4jWebConstants.RESOURCE_FF4J); statisticBean.setListOfFeatures(new ArrayList<Feature>(storeHTTP.readAll().values())); // Display output page ModelAndView mav = new ModelAndView(VIEW_STATS); mav.addObject(ATTR_ENVBEAN, envBean); mav.addObject(ATTR_STATISTICBEAN, statisticBean); return mav; }