Spring
-
Java SpringBoot 개요Spring 2023. 7. 7. 16:03
Springboot 구조 Spring Boot 주요 특징 2014년 4월 version 1.0 공개 SpringFramework보다 빠른 웹 프로젝트 생성가능 Tomcat이나 Jetty가 내장되어 프로젝트를 .jar 파일 형태로 간단히 배포할 수 있다. 스프링 응용프로그램을 독립적으로 작성, 빌드, 실행 수 있으며 Embeded Tomcat, jetty의 사용이 가능하므로, WAR 파일로 빌드해서 배포할 필요가 없다 복잡한 xml 설정을 간소화하여 어노테이션 기반의 java config로 교체하여 쉬운 서버 설정이 가능
-
Java SpringFramework 개요Spring 2023. 7. 7. 15:36
Java SpringFramework 개요 Java SpringFramework - DI(DependencyInjection) Java SpringFramework - AOP Java SpringFramework - MVC Springboot 구조 SpringFramework는 EJB(Enterprise Java Beans)를 주 프레임워크로 사용할 때 불편한 점들을 개선하기 위해 2002년 Rod Johnson(로드 존슨)이 출판한 도서 'Expert One-on-One J2EE Design and Development'에 선보인 코드가 Spring의 시작이 되었다. 2003년6월 Apache 2.0 License로 SpringFramework가 공개 되었다. Spring Framework Artifa..
-
-
PathVariable Url경로에서 값 읽기Spring 2022. 9. 28. 16:47
Client에서 요청한 경로에서 PathVariable이 값을 읽어준다. html DeleteA DeleteB DeleteC java spring import org.springframework.web.bind.annotation.PathVariable; @GetMapping("/delete{id}") //ex delete123 public String mustache1DeletePage(@PathVariable Long id) { //work log.info("req delete id="+id); return "redirect:/mustache1/list"; }
-
RequestParam Get방식 값 읽기Spring 2022. 9. 28. 16:41
Client에서 요청할 때 Get방식으로 값을 보낼 경우 RequestParam으로 읽는다 html TestAdd Add java spring import org.springframework.web.bind.annotation.RequestParam; @GetMapping("/testadd") //ex: testadd?num=100 public String mustache1TestaddPage(@RequestParam Long num) { for(int i = 0; i < num; i++) { //work... } return "redirect:/list"; }
-
lombokSpring 2022. 9. 27. 10:55
사용준비 dependencies { ... compileOnly('org.projectlombok:lombok') annotationProcessor('org.projectlombok:lombok') ... } AllArgsConstructor 생성자를 자동으로 만들어 준다. 모든 멤버 변수를 대입. 아래 주석처리한 코드들이 컴파일 타임에 자동으로 만들어져 동작한다. import lombok.AllArgsConstructor; @AllArgsConstructor public class MustacheTest1Form1 { public Long id; public String title, content; //@ToString // @Override // public String toString() { //..
-
Springboot Db기록ExSpring 2022. 9. 26. 20:43
2022.08.06 - Vsc Spring Boot 사용 준비 2022.09.25 - Vsc Spring Boot 설치 2022.09.25 - Springboot Mustache 준비 의존관계 dependencies { ... implementation 'org.springframework.boot:spring-boot-starter-mustache' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation group: 'javax.persistence', name: 'javax.persistence-api', version: '2.2' implementation group: 'com.h2database', ..