Last active
December 26, 2015 20:19
-
-
Save rankun203/7207805 to your computer and use it in GitHub Desktop.
SpringMVC 指定返回页面的两种方式
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping("/") | |
public ModelAndView welcome (ModelMap model) { | |
ModelAndView view = new ModelAndView("index"); | |
model.addAttribute("introSelf", "I'm Spring, I'm Coming."); | |
return view; | |
} | |
@RequestMapping("/") | |
public String welcome (ModelMap model) { | |
model.addAttribute("introSelf", "I'm Spring, I'm Coming."); | |
return "index"; | |
} | |
//ModelMap 对象可以用来存储回传变量 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment