Spring/Spring Boot
-
[spring Boot] Controller 어노테이션 정리Spring/Spring Boot 2024. 8. 8. 16:02
▤ 목차">HTML 삽입미리보기할 수 없는 소스 ✔ @Controller 클라이언트의 요청이 들어오면 DispatcherServlet이 요청을 받는다.dispatcherServlet은 hardler에게 자신의 일을 위임한다. Handler는 요청에 맞는 컨트롤러를 찾고 컨트롤러 실행 결과를 반환한다. 이후 dispatcherServlet는 받은 결과와 함께 viewResolver에게 위임한다. veiw 정보를 찾아 view를 가지고 클라언트에게 응답한다. ✏️역할해당 클래스가 웹 애플리케이션의 컨트롤러임을 나타낸다.MVC의 핵심 요소중 하나이며, 클라이언트의 요청을 처리하는 비즈니스 로직과 뷰를 결합하여 전체적인 웹 애플리케이션의 동작을 제어한다.스프링 컨테이너는 @Controller 어노테이션이 지..
-
[spring Boot] Thymeleaf 페이지 레이아웃Spring/Spring Boot 2024. 8. 6. 12:34
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 ✔ Thymeleaf Layout Dialect dependency 추가 ***⌨ build.gradle > dependencies 설정implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' 반드시 넣어줘야한다. dependency를 추가하고 나면 프로젝트를 refresh 해줘야한다. 👻 Refresh Gradle Project 해당 파일 우클릭 > gradle > Refresh Gradle Project 을 눌러 프로젝트를 리플레쉬해준다. ✔컨트롤러 작성✨ 형식@Controller@RequestMapping(value="thleaf")publi..
-
[Spring Boot] view 페이지, 템플릿 엔진에 대해서(jsp VS thymeleaf)Spring/Spring Boot 2024. 8. 5. 20:15
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 ✔ view 환경 설정📌 스프링의 시작페이지(index.html)파일에서 static폴더에 index.html 라는 이름의 파일을 만들자.이는 spring에서 제공하는 welcome page이다. 이 파일은 정적페이지로 파일을 그대로 웹브라우저에 전달한다.전달받은 웹브라우저는 해당 파일을 파싱한다. 🌐 파싱(parsing)과 파서(parser)👏 파서(parser)문법이나 형식으로 작성된 데이터를 읽어서 그 구조를 해석, 변환하는 프로그램을 말한다.컴파일러나 인터프리터의 구성 요소 가운데 하나이며 입력 토큰에 내재된 자료 구조를 빌드하고 문법을 검사할때 사용된다.웹 개발에서 html, xml, json 등의 ..
-
[springBoot] spring boot 실행 시 로그Spring/Spring Boot 2024. 8. 2. 17:43
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 메인 메서드를 실행하면 spring이 내장하고 있는 톰켓을 실행하면서 로그가 찍힌다. ✔ 로그 읽기실무에서 개발하고 관리할때 발생할 수 있는 다양한 이슈룰 파악하고 해결하기 위해 로그를 읽는 것이 익숙해야한다.스프링 프레임워크를 통해 웹 애플리케이션을 개발할 때발생하는 초기화, 설정, 서버 시작 등 중요한 정보를 포함하고 있다. ⌨ 파일 형식프레임워크를 사용해 돌린 프로젝트는 pack 패키지이며 프로젝트이름은 test1이다. 💻 Starting Test1Application using Java 17.0.10 with PID 37972 (C:\ ... 애플리케이션 시장 정보. 로그의 시작을 나타내는 로그이다.애플리케이..
-
[springBoot] 기본 환경 설정Spring/Spring Boot 2024. 8. 1. 19:03
👻 시작하기에 앞서지금까지 java 17버전(maven_이클립스), tomcat 9버전, mariaDB를 사용했다. springBoot를 설정하는 방법은 크게 2가지로 나뉜다.1. 웹을 통해 환경설정하기2. 이클립스(idle)에서 설정하기 ✨ 웹(https://start.spring.io)에서 환경설정하기 1) https://start.spring.io/에 들어간다. 이런 화면이 나오는데, 원하는 환경에 맞게 설정하면 된다. 이때 dependencies 설정하는게 중요하다.기본적으로 아래 2개만 설정해놓아도 돌아가는데는 큰 무리없다.(사용하면서 추가할 예정!) 필요한 환경 설정을 하고나서 generate를 누르면 환경 잡힌 파일이 다운로드 받아진다.해당 파일을 압축을 풀어두자. 2) import..