1.세팅

강재영's avatar
Aug 14, 2024
1.세팅
 

1.1 java를 21버전으로 한다.

notion image
 
 
notion image
 
 

1.2 lombok설정

notion image
 
 

1.3 자동정렬

단추키는 ctrl + alt + L 근데 컨트롤 S만해도 정렬이 된다.
notion image
 
 

라이브러리(그래들 패키지매니저)

dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-mustache' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' }
 
내장톰켓이 실행되는 모습
notion image
 
 
static에 파일만 넣고 실험해보기(url로)
notion image
 
notion image
 
url에 파일이름을 넣으면 나오는걸 확인할 수 있다.
 
아파치는 정적파일만
아파치가 이해하지못하는 파일이나 식별자가 요청이오면 톰켓한테 위임힌다.
 
아파치와 톰켓을 함께 was라고 한다.
 
jsp, mustache는 템플릿 엔진이다.
서버사이드랜더링 서버에서 만들어서 순수 html파일을 브라우저에게 돌려준다.
 

1.4 mustache사용하기

자바코드를 섞어 쓸수 있는 파일들은 templates 파일에 넣는다.
(정적파일에서 html을 없애고 mustache로 바꿈)
Tip .keep파일을 추구해서 tamplates폴더 아래 board디렉토리가 나오게한다.
notion image
 
 
notion image
 

1.5 식별자 요청하기

notion image
 
notion image
 
 
 
 
 
 
 
 
Share article

강재영 블로그