List of usage examples for org.springframework.web.servlet ModelAndView addObject
public ModelAndView addObject(String attributeName, @Nullable Object attributeValue)
From source file:io.manasobi.security.UserDetailsController.java
@ExceptionHandler(MongoTimeoutException.class) public ModelAndView handleError(HttpServletRequest req, Exception exception) { ModelAndView mav = new ModelAndView(); mav.addObject("msg", exception); mav.addObject("url", req.getRequestURL()); mav.setViewName("error"); return mav;//from ww w . jav a2s. c om }
From source file:com.sab2i.sabweb.controller.ComplexMathController.java
@RequestMapping(path = "/welcome.do", method = RequestMethod.GET) public ModelAndView hello() { String message = String.valueOf(calculator.doComplexMath(10, 5)); ModelAndView modelAndView = new ModelAndView("welcome"); modelAndView.addObject("message", message); return modelAndView; }
From source file:controller.ProductlistController.java
protected ModelAndView handleRequestInternal(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception { ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml"); DbTable productMng = (DbTable) context.getBean("DbTable"); ModelAndView model = new ModelAndView("Viewproduct"); model.addObject("list", productMng.getProduct()); return model; }
From source file:nl.mok.mastersofcode.spectatorclient.controllers.IndexController.java
@RequestMapping(method = RequestMethod.GET) public ModelAndView showIndex(final HttpServletRequest request) { ModelAndView mav = new ModelAndView(); mav.addObject("page", new Object() { public String uri = "/spec/"; public String redirect = request.getRequestURL().toString(); });/*from ww w . j a v a2s .c o m*/ mav.addObject("competitions", DataController.getCompetitions()); mav.addObject("currentCompetition", DataController.getCurrentCompetition()); mav.addObject("currentRound", DataController.getCurrentRound()); mav.setViewName("index.twig"); return mav; }
From source file:com.kdgregory.pathfinder.test.spring3.pkg2.ControllerD.java
@RequestMapping(value = "{id}", method = RequestMethod.GET) protected ModelAndView getD(HttpServletRequest request, HttpServletResponse response, @PathVariable String id) throws Exception { ModelAndView mav = new ModelAndView("simple"); mav.addObject("reqUrl", request.getRequestURI()); mav.addObject("controller", getClass().getName()); mav.addObject("id", id); return mav;//from w w w. j a v a 2 s .c o m }
From source file:com.neeti.neg.controller.GlobalExceptionController.java
@ExceptionHandler(NEGRuntimeException.class) public ModelAndView handleCustomException(NEGRuntimeException ex) { ModelAndView model = new ModelAndView("errorpage"); model.addObject("errMsg", ex.getMessage()); return model; }
From source file:com.seabee.snapdragon.controller.SecurityNavigation.java
@RequestMapping(value = "/error-login", method = RequestMethod.GET) public ModelAndView invalidLogin() { ModelAndView modelAndView = new ModelAndView("login-form"); modelAndView.addObject("error", true); return modelAndView; }
From source file:controller.CustomerlistController.java
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml"); DbTable customerMng = (DbTable) context.getBean("DbTable"); ModelAndView model = new ModelAndView("Viewcustomer"); model.addObject("list", customerMng.getCustomer()); return model; }
From source file:nl.mok.mastersofcode.spectatorclient.controllers.TeamController.java
@RequestMapping(method = RequestMethod.GET, value = "/{username}") public ModelAndView showTeam(final HttpServletRequest request, @PathVariable String username) { ModelAndView mav = new ModelAndView(); mav.addObject("page", new Object() { public String uri = "/spec/team"; public String redirect = request.getRequestURL().toString(); });/*from w w w . j a va2 s .c om*/ mav.addObject("team", DataController.getTeamById(username).orElse(null)); mav.addObject("currentCompetition", DataController.getCurrentCompetition()); mav.addObject("currentRound", DataController.getCurrentRound()); mav.setViewName("team.twig"); return mav; }
From source file:org.iaws.controller.AreaController.java
@Override protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView model = new ModelAndView("area"); model.addObject("stopArea", parser.pGetAreaStopList(handler.getStopArea())); return model; }