MCPcopy Create free account
hub / github.com/castello/spring_basic / main

Method main

ch2/YoilTellerMVC.java:12–30  ·  view source on GitHub ↗
(int year, int month, int day, Model model)

Source from the content-addressed store, hash-verified

10@Controller
11public class YoilTellerMVC {
12 @RequestMapping("/getYoilMVC") // http://localhost/ch2/getYoilMVC
13 public String main(int year, int month, int day, Model model) {
14
15 // 1. 유효성 검사
16 if(!isValid(year, month, day))
17 return "yoilError"; // 유효하지 않으면, /WEB-INF/views/yoilError.jsp로 이동
18
19 // 2. 처리
20 char yoil = getYoil(year, month, day);
21
22 // 3. Model에 작업 결과 저장
23 model.addAttribute("year", year);
24 model.addAttribute("month", month);
25 model.addAttribute("day", day);
26 model.addAttribute("yoil", yoil);
27
28 // 4. 작업 결과를 보여줄 View의 이름을 반환
29 return "yoil"; // /WEB-INF/views/yoil.jsp
30 }
31
32 private char getYoil(int year, int month, int day) {
33 Calendar cal = Calendar.getInstance();

Callers

nothing calls this directly

Calls 2

isValidMethod · 0.95
getYoilMethod · 0.95

Tested by

no test coverage detected