Created
January 16, 2013 16:51
-
-
Save ageldama/4548749 to your computer and use it in GitHub Desktop.
Spring Web MVC Example.
This file contains hidden or 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
| @Controller | |
| public class CalcController { | |
| @RequestMapping("/") | |
| public void welcomeHandler() { | |
| } | |
| @RequestMapping("/plus") | |
| public ModelMap plus(Integer a, Integer b) { | |
| ModelMap m = new ModelMap(); | |
| // JSP에서 표시할 내용들을 바인딩. | |
| m.put("a", a); | |
| m.put("b", b); | |
| m.put("result", a + b); // a+b=? | |
| return m; | |
| } | |
| } |
This file contains hidden or 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
| ${a} + ${b} = <b>${result}</b> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment