프로그래밍/JAVA\Spring(4)
-
컴포넌트 스캔
@ComponentScan @Component가 붙은 클래스를 컴포넌트 스캔의 대상이되 지정된 것들을 빈으로 등록해줌 @ComponentScan(excloudeFilter = @Filter(type = FilterType.AMMOTATION, classes = 클래스 이름.class)) 해당 클래스를 제외하고 컴포넌트 등록됨 자동 의존관계주입 @Autowired public class AutoAppConfigTest { @Test void basicScan(){ AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(AutoAppConfig.class); Memver Service memberService = ac.ge..
2022.08.14 -
[Spring]Spring Boot 의 Ammotation과 간단 한줄요약
@StringBootApplication Spring boot application으로 설정 @Controller View를 제공하는 controller로 설정(화면주소를 반환) @RestController REST API를 제공하는 controller로 설정(데이터 값을 반환) @RequestMapping URL 주소를 매핑(아래 4가지 모두 실행) @GetMapping Http getMethod URL 주소맵핑 @PostMapping Http PostMethod URL 주소맵핑 @PutMapping Http PutMethod URL 주소맵핑 @DeleteMapping Http DeleteMethod URL 주소맵핑 @RequestParam URL Query Parameter 맵핑 @RequestBod..
2022.01.19 -
[Spring] class 이름 중복으로 인한 오류
패캠의 spring 강의를 듣는 도중 오류발생 org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.example.hello.HelloApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'apiController' for bean class [com.example.hello.reponse.controller.ApiController] conflicts with existing,..
2022.01.12 -
(JAVA)배열을 이용한 비행관리프로그램
이차배열을 이용하여 운항 정보에대한 리스트 생성, 수정, 삭제가 가능한 프로그램을 만들어보았다. 아래 코드는 리스트에 정보를 저장하고 수정가능하게 한다. public class AmsField{ String [][] arrPlane = new String[100][5]; int cnt; int showCnt; int cLength = arrPlane[0].length; String result = ""; int updateIndex; void insert(String [] arPlane) { arrPlane[cnt] = arPlane; cnt++; } //검색하기 String search(String keyword, int index) { int arIndex[]; String result = ""; i..
2020.06.30