'Web 개발' 카테고리의 글 목록 (7 Page)
본문 바로가기

반응형

Web 개발

(53)
[Spring Boot/JPA] 게시판을 통해 MVC, CRUD 연습하기 2 - 등록 Spring Boot + H2 Database + JPA + Thymeleaf 을 활용해 간단한 게시판을 작성해보고자 합니다. 오늘 다룰 내용은 게시판 글 작성 기능입니다. 글에 포함된 기초 개념 Get Mapping / Post Mapping 차이 Spring annotation - @Transactional * 개발환경 Spring Boot : 2.4.3 Java 11 Thymeleaf Maven War Lombok ① List.html에 글쓰기 버튼 추가 글쓰기 번호 글제목 작성자 작성일 ② List.html에서 글쓰기 버튼 클릭 시, 이동할 페이지 작성 form을 통해 Post 방식으로 데이터 전달 이때, 추후에 로그인기능을 추가하기 위해서는 th:action으로 넘기거나, csrf token 을..
[Spring Boot/JPA] 게시판을 통해 MVC, CRUD 연습하기 1 - 목록 Spring Boot + H2 Database + JPA + Thymeleaf 을 활용해 간단한 게시판을 작성해보고자 합니다. 오늘은 게시판 글 목록 보여주는 기능입니다. * 개발환경 Spring Boot : 2.4.3 Java 11 Thymeleaf Maven War Lombok ① templates 에 List.html 생성 List.html에 작성한 글을 보여줄 테이블 생성 번호 글제목 작성자 작성일 ② Java > controller 패키지 하위에 Board Controll 클래스 생성 Board Controller에 list() 메소드 생성 Service를 통해 boardDtoList를 boardList로 넘겨받아서 view에 전달 import com.example.demo.dto.BoardDt..
[H2 DB] H2 데이터베이스 생성 또는 실행시키는 방법 H2 Database 실행시키는 법 1. H2 를 설치한 위치로 진입 2. bin 폴더 내에 h2.bat 배치파일 실행 3. 배치파일을 클릭하면 콘솔이 실행됨 콘솔에 DB 정보 입력 후 연결버튼 클릭 (DB가 없을 경우 자동으로 생성됨) 4. 연결이 되지 않을 경우 배치파일이 실행중인지 확인하고, 이상이 없을 경우 DB 종료 후 다시 시도 (작업표시줄에서 Exit을 통해 종료)
[IntelliJ/HTML/Spring Boot] cannot resolve mvc view 'index.html' 프로젝트를 생성 시, Spring Web, JPA 을 추가했더니 configuration을 추가하지 않아도 해결되었다. 따라서 프로젝트를 새로 생성하거나, 다음과 같이 poem.xml 과 application.yml을 수정할 것을 권장 // poem.xml org.hibernate hibernate-entitymanager 5.3.10.Final org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat provided org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-s..
[Spring Boot] 프로젝트 생성하는 방법 ( IntelliJ, SpringBoot, JPA, H2 DB ) 1. spring initializr 를 통해 프로젝트 생성 1) spring initializr 접속 start.spring.io/ 2) 필요한 옵션 선택 후, Generate 버튼을 클릭하여 압축파일 다운로드 (예시로는 Maven, Java, SpringBoot 2.4.3, War, Java11 SpringBoot DevTools, Lombok, Spring Configuration Processor, Spring Web, Thymeleaf, Spring Data JPA, Validation, H2 Database 선택) 3) 압축을 해제한 뒤 툴(IntelliJ or VScode or Eclipse STS 등)을 이용하여 열기

반응형