기본객체들 404
저와 같이 고생하시는 분 계실까 싶어 공유 해드립니다어떤 이유인지는 모르겠으나 static class를 getMapping 보다 내리니 문제가 해결되었습니다.package hello.thymeleaf.basic; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpSession; import lombok.Data; import org.springframework.stereotype.Component; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @Controller @RequestMapping("/basic") public class BasicController { @GetMapping("text-basic") public String textBasic(Model model) { model.addAttribute("data", "Hello Spring!"); return "/basic/text-basic"; } @GetMapping("text-unescaped") public String textUnescaped(Model model) { model.addAttribute("data", "Hello Spring!"); return "/basic/text-unescaped"; } @GetMapping("/variable") public String variable(Model model) { User userA = new User("userA", 10); User userB = new User("userB", 20); List list = new ArrayList(); list.add(userA); list.add(userB); Map map = new HashMap(); map.put("userA", userA); map.put("userB", userB); model.addAttribute("user", userA); model.addAttribute("users", list); model.addAttribute("userMap", map); return "basic/variable"; } @GetMapping("/basic-objects") public String basicObjects(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) { session.setAttribute("sessionData", "Hello Session"); model.addAttribute("request", request); model.addAttribute("response", response); model.addAttribute("servletContext", request.getServletContext()); return "basic/basic-objects"; } @GetMapping("/date") public String date(Model model) { model.addAttribute("localDateTime", LocalDateTime.now()); return "basic/date"; } @Data static class User { private String username; private int age; public User(String username, int age) { this.username = username; this.age = age; } @Component("helloBean") static class HelloBean { public String hello(String data) { return "Hello " + data; } } } }