snaag / TIL

https://github.com/snaag/todo3/issues
3 stars 0 forks source link

22-11-13-SUN #11

Open snaag opened 1 year ago

snaag commented 1 year ago
snaag commented 1 year ago

스프링 입문 강의 > 프로젝트 환경설정

1. View 환경설정

spring boot 에서 사용할 수 있는 template engine

welcome page 만들기

Controller + template engine 으로 값을 동적으로 받는 페이지 만들기

@Controller
public class HelloController {
    @GetMapping("hello")
    public String hello(Model model) {
        model.addAttribute("data", "hello!!");
        return "hello";
    }
}
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Hello</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="'안녕하세요. ' + ${data}" >안보이는 텍스트임</p> <!-- A: 동적으로 값 넘어감 -->
</body>
</html>
image

spring-boot-devtools

snaag commented 1 year ago

스프링 입문강의 > 프로젝트 환경설정

2. 빌드하고 실행하기

터미널에서 빌드하고 실행하기

jar 파일이란?

https://crazykim2.tistory.com/631

image
snaag commented 1 year ago

스프링 입문강의 > 스프링 웹 개발 기초

1. 정적 컨텐츠

웹 개발

Spring boot 의 정적 컨텐츠

image
snaag commented 1 year ago

스프링 입문강의 > 스프링 웹 개발 기초

2. MVC 와 템플릿 엔진

MVC ? Model, View, Controller.

template engine (thymeleaf)

image
snaag commented 1 year ago

Intellij tip