thymeleaf 6

Spring Boot으로 웹 출시 - thymeleaf에서 form 전송

Spring Boot, thymeleaf를 이용해서 form 전송 방법 알아보기 form 유효값 체크할 수 있는 Validator 작성하기 JPA를 이용해서 DB에 데이터 추가, 수정 Bootstrap으로 form 검색하고 form.html파일을 만들어준다. form.html 게시판 제목 제목 에러 메시지 내용 제목 에러 메시지 취소 삭제 확인 list.html은 아래와 같다. 게시판 총 건수 : 검색 검색 번호 제목 작성자 Mark Otto 홍길동 Previous 1 Next 쓰기 이제 form.html과 controller을 연결시켜주자. package com.example.myhome.controller; import com.example.myhome.model.Board; import com.ex..

Spring/SpringBoot 2022.06.02

Spring Boot으로 웹 출시까지 #4. thymeleaf를 이용해 레이아웃 만들기

여기서 설정을 해주자. 일단은 대략적으로 진행은 아래와 같다. git 연동을 통한 소스 관리 Bootstrap을 이용하여 반응형 웹 페이지 구성하기 Fragment를 이용해서 공통 화면 레이아웃 구성하기 MyhomeApplication 확인하고 package com.example.myhome; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MyhomeApplication { public static void main(String[] args) { SpringApplicati..

Spring/SpringBoot 2022.05.31

Spring Boot으로 웹 출시까지 #3. thymeleaf 기본 익히기

thymeleaf는 Spring Boot에서 권장하는 JSP를 대체하는 서버사이드 자바 템플릿 엔진 Spring Boot에서 JSP보다 더 간단한 설정과 HTML 표준 문법으로 thymeleaf를 이용해 HTML을 작성할 수 있다. thymeleaf는 HTML 문법을 기반으로 한다. Name Price Oranges 0.99 thymeleaf tutorial에서 Using Texts를 참고해보자. 텍스트 사용에서 참고할 내용은 간단하다. th 붙은 내용이 thymeleaf에서 구동이 된다. href="../../css/gtvg.css" th:href="@{/css/gtvg.css}" /> Welcome to our grocery store! 4. Standard Expression Syntax 서버 기동..

Spring/SpringBoot 2022.05.30

Spring Boot으로 웹출시 - thymeleaf를 이용한 화면 작성

여기서 진행한다. Serving Web Content with Spring MVC title을 참고하여 만들어 주었다. Thymeleaf Spring Web Spring Boot DevTools 세 개의 Dependencies를 ADD해주고 project를 generate 해주자. GreetingController 패키지를 만들어주고 class를 작성해준다. package com.example.mythymeleaf.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import..

Spring/SpringBoot 2022.05.30

Spring Boot으로 웹 출시까지

여기서 프로젝트를 시작해보자. 그리고 Building Restful Web Service 사이트에서 튜토리얼을 진행 해준다. Greeting Class package com.godcoder.myrest; public class Greeting { private final long id; private final String content; public Greeting(long id, String content) { this.id = id; this.content = content; } public long getId() { return id; } public String getContent() { return content; } } GreetingController Class package com.god..

Spring/SpringBoot 2022.05.30

프로젝트 환경설정 - View 환경 설정

main폴더에 jpabook.jpashop폴더에서 HelloController Class를 만들어준다. @Controller annotation을 달아준다. hello라는 url로 오면 Controller가 호출되겠다고 하는 것이다. model에 아무 값이나 담는다 Model model에 데이터를 실어서 view에 넘길 수 있게 해준다. data key의 값을 hello라는 걸로 넘길거고 // HelloController package jpabook.jpashop; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.G..

Spring/SpringBoot 2022.03.30