목록Spring/연습 (14)
충분히 쌓여가는
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/d3bMjT/btsw2Fwn6tv/r4hgty1YRgK3hptupfRDmK/img.jpg)
test.html [[${firstName}]] Controller @GetMapping("/test") public String test(Model model) { model.addAttribute("lastName", "enough"); model.addAttribute("firstName", "build"); return "test"; } text와 utext [[${firstName}]] |(리터럴 치환) [[${firstName}]]
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/uba6X/btswwOHbcjh/zt9NAmgVNoQOCfL0dNrTck/img.jpg)
package com.buildenough.ch2; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @RequestMapping("/login") @Controller public class LoginController { @GetMa..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/cVMjVe/btswbyZxO5j/eSMRP0P0A2rFV0ku08pR60/img.jpg)
@GetMapping @RequestMapping("/login/login") @RequestMapping(value="/login/login", method=RequestMethod.GET) @GetMapping("/login/login) @PostMapping @RequestMapping(value="/login/login", method= RequestMethod.POST) @PostMapping("/login/login") 하나의 메서드로 GET, POST 둘 다 처리하는 경우 @RequestMapping(value="/login/login", method={RequestMethod.GET, RequestMethod.POST})
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/cd7eVN/btswbA30xQD/yzYQJgLQOc3eJywc1Vp0tk/img.jpg)
YoilTeller(기존 코드) 매개변수가 int year, int month, int day로 되어 있다 package com.buildenough.ch2; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import java.io.IOException; import java.util.Calendar; @Controller public class YoilTeller { @RequestMapping("/getYoil") public String main(int year, int month..