본문 바로가기

spring boot15

spring boot 복습 spring boot api를 만들어 준다. package 는 이렇게 되어있다. 주소 맵핑 @controller 주소 -> html ->@ResponseBody 스트링문자열 @Service 서비스 @Repository 디비 관리 @RestControlle -> string 문자열 @GetMapping 주소 줄 @ResponseBody 문자열 알아야 하는것이다. ●main package com.mh.restapi01; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.Applicat.. 2024. 3. 4.
spring boot 입출력 2 @SpringBootApplication 이건 com.git.ex03 패키지 안에서만 쓸 수 있다. 이안에서 객체 생성을 할 수 있다. @ComponentScan(value = "aa.bb.cc", excludeFilters = { @ComponentScan.Filter(type = FilterType.ANNOTATION,classes = MaauaBean.class) }) 이렇게 하면 파일명(aa.bb.cc)안에 있는 AAA는 IOC컨테이너 안에 들어갈 수 없다 . @ComponentScan 이거에 뒤에 (파일명)을 작성하고 @Component 그파일에 @Component를 넣어주면 객체 생성을 한것이다. 이렇게 하면 객체 생성을 할 수 있다. @Retention(RetentionPolicy.RUNTI.. 2024. 2. 27.
Spring boot(수업중 내용 입출력) spring boot 에 대한 기본 설정을 spring.io에 만들어 준다. 주소맵핑 @controller @GetMapping 환경설정 @configuration 객체 주입 @bean 객체 불러오기 @autowired =========================== (오늘 암기 해야 할것) ●port change application.properies 에서 server.fort = 8081 이렇게 하면 포트가 8080에서 8081로 포트가 변경 된다. http://localhost:8081 이렇게 적으면 -> index.htnl // 제일 기본 페이지 http://localhost:8081/regist -> regist.html http://localhost:8081/list -> list.html .. 2024. 2. 26.