Spring boot에서 java 변수값을 템플릿에 출력하기
javaimport org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.GetMapping;@Controllerpublic class MyController { @GetMapping("/show-variable") public String showVariable(Model model) { String message = "Hello, Spring Boot!"; model.addAttribute("myVariable", message); // Add the variable to the model ..
2024.11.17