목록Spring (82)
충분히 쌓여가는
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}]]
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..
@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})
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..