반응형

초보개발자 3

자바 미니 솔루션 (1) - 학생 관리 시스템

Git : https://github.com/dddddni/StudentManage 자바 강의 다 듣고 까먹지 않게 흔한 학생 관리 시스템을 구현했다. ArrayList만을 이용해서 만들었고 추후 수정하면서 개선해나갈 예정이다 클래스 1) 교수 package Entity; public class Professor { public Professor(String name, String subject, int number) { this.name = name; this.subject = subject; this.number = number; } public String getName() { return name; } public void setName(String name) { this.name = name; ..

개발/Java 2023.02.21

Spring Boot에서 JUnit 사용

JUnit이란? 자바 테스트 tool로 'org.springframework.boot:spring-boot-starter-test'에 의존성에 포함 /test 폴더에서 작업 예제 package hello.hellospring.service; import hello.hellospring.domain.Member; import hello.hellospring.repository.MemoryMemberRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.As..

개발/Spring 2023.01.17

Spring Boot 동작 원리

1. 동적페이지 (resources/templates) // http://localhost:8080/hello @Controller public class HelloController { @GetMapping("hello") public String hello(Model model) { model.addAttribute("data", "hello!!"); return "hello"; } } 1. 사용자가 Request시, 내장 Tomcat이 스프링 컨테이너에서 hello가 Mapping 되어 있는 Controller를 찾는다. -> 있음 2. mapping되어 있는 함수 호출 후, Return 처리 3. Return이 문자열인 경우, ViewResolver를 통해 resources/templates/에서..

개발/Spring 2023.01.13
반응형