스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
https://www.inflearn.com/course/스프링-입문-스프링부트/dashboard
섹션 0. 강의 소개
간단한 웹 애플리케이션 개발
- 스프링 프로젝트 생성
- 스프링 부트로 웹 서버 실행
- 회원 도메인 개발
- 웹 MVC 개발
- DB 연동 - JDBC, JPA, 스프링 데이터 JPA
- 테스트 케이스 작성
섹션 1. 프로젝트 환경설정
1.1 프로젝트 생성
1.2 라이브러리 살펴보기
핵심 라이브러리
Gradle은 의존관계가 있는 라이브러리를 함께 다운로드 한다.
스프링 부트 라이브러리
테스트 라이브러리
1.3 View 환경설정
Welcome Page 만들기
스프링 부트가 제공하는 Welcome Page 기능
<!DOCTYPE HTML>
<html>
<head>
<title>Hello</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
Hello
<a href="/hello">hello</a>
</body>
</html>
spring boot 기능 확인
https://docs.spring.io/spring-boot/docs/current/reference/html/
Spring Boot Reference Documentation
The reference documentation consists of the following sections: Legal Legal information. Getting Help Resources for getting help. Documentation Overview About the Documentation, First Steps, and more. Getting Started Introducing Spring Boot, System Require
docs.spring.io
welcome page 기능 확인 (spring.io)
thymeleaf 템플릿 엔진
package hello.hellospring.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@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>
</body>
</html>
동작 환경 그림
1.4 빌드하고 실행하기
콘솔로 이동
FIN.
[스프링 핵심 원리 - 입문] week06 (0) | 2022.09.11 |
---|---|
[스프링 핵심 원리 - 기본편] week05 (0) | 2022.09.01 |
[스프링 핵심 원리 - 기본편] week04 (0) | 2022.08.28 |
[스프링 핵심 원리 - 기본편] week03 (0) | 2022.08.18 |
[스프링 핵심 원리 - 기본편] week02 (0) | 2022.08.14 |
댓글 영역