@RequestMapping(value = "/welcome", method = RequestMethod.GET) public ModelAndView welcome(Model model) { LOG.debug("move to welcome page"); model.addAttribute("object", "Test string"); ModelAndView modelAndView = new ModelAndView("welcome"); return modelAndView; }
@Controller public class RootController { private static final LoggerWrapper LOG = LoggerWrapper.get(RootController.class); @RequestMapping(value = "/", method = RequestMethod.GET) public String root() { LOG.debug("redirect from root to welcome"); return "redirect:welcome"; } @RequestMapping(value = "/welcome", method = RequestMethod.GET) public ModelAndView welcome(Model model) { LOG.debug("move to welcome page"); model.addAttribute("object", "Test string"); ModelAndView modelAndView = new ModelAndView("welcome"); return modelAndView; } }
@RequestMapping(value = "/", method = RequestMethod.GET) public String root() { LOG.debug("redirect from root to welcome"); return "redirect:welcome"; }