본문 바로가기
728x90
반응형

IT/Spring42

[Spring] - 스프링 Bean 등록(Annotation, XML) 하는 방법 #스프링 Bean 등록(Annotation, XML) 하는 방법 #Annotation @Component : bean으로 등록 bean등록 어노테이션 @Controller : 요청과 응답처리 @Repository : DAO(파일, 데이터베이스) @Service : Command(비즈니스 로직) #@Component package org.green.di_test; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /* * Annotation * @Component : bean으로 등록 * * bean등록 어노테이션 * @Controller : * @Repositor.. 2020. 8. 13.
[Spring] - 스프링 @RequestMapping 어노테이션 사용 방법 #스프링 @RequestMapping 어노테이션 사용 방법 -URL을 Controller에 매핑해주는 역할을 합니다. #파라미터 종류 HttpServletRequest request, response, session, OutputStream/Writer # 파라미터 값 받아오는 방법 @RequestParam("파라미터이름") @RequestParam(value="파라미터이름", required=false, default="1") ->required : false(없으면) ->default : 값이 없을때 기본 값 @ModelAttribute("속성이름") @CookieValue("쿠키이름") @CookieValue(value="쿠키이름", required=false, defaultValue="1") @P.. 2020. 8. 13.
[Spring] - 스프링 Maven Repository에서 mysql 라이브러리 적용 하는 법 #스프링 Maven Repository에서 mysql 라이브러리 적용 하는 법 1. Maven Repository 사이트 링크 https://mvnrepository.com/ Maven Repository: Search/Browse/Explore Solon Boot JLHTTP Last Release on Aug 11, 2020 mvnrepository.com 2. mysql jdbc드라이버를 검색합니다. 3. 검색 후 원하는 버전 클릭합니다. 4. 아래의 Maven탭의 코드를 복사합니다. (클릭시 자동 복사 됩니다.) 5. 스프링 레거시 프로젝트에서 pom.xml를 엽니다. -pom.xml안에 dependencies태그 안쪽에 복사 해주면 라이브러리에 자동으로 적용됩니다. 2020. 8. 13.
[Spring] - 스프링 한글 처리 하는 방법(web.xml) #스프링 한글 처리 하는 방법(web.xml) #한글 처리 주석 참조(EUC-KR 대신 UTF-8등 원하는 방식으로 변환 가능) -web.xml contextConfigLocation /WEB-INF/spring/root-context.xml org.springframework.web.context.ContextLoaderListener appServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/spring/appServlet/servlet-context.xml 1 appServlet / encodingFilter org.springframework.web.filter.CharacterEncoding.. 2020. 8. 13.
[Spring] - 스프링 개념 정리(DI, IOC, AOP) #스프링 개념 정리(DI, IOC, AOP) -Java 기반 응용 프로그램 개발 프레임워크 #특징 -POJO -IoC -DI -AOP -데이터베이스 라이브러리 지원 #SPRING FRAMEWORK -dependency injection -transaction management -web apps -data access -messaging #스프링이 관리 ViewResolver : 뷰 요청, 응답 (servlet-context.xml) DispactcherServlet : 클라이언트의 요청을 받아서 처리 HandlerMapping : URL = 컨트롤러, 컨트롤러 지정 #웹 개발 -MVC -> DI -> 느슨한 결합력과 인터페이스 -트랜잭션 -> AOP -인증과 권한 -> Servlet Filter #느슨.. 2020. 8. 13.
[Spring] - 스프링(Spring Tool Suite) STS 다운로드 및 설치 방법 #스프링(Spring Tool Suite) STS 다운로드 및 설치 방법 1. 설치 파일 다운로드 링크 https://spring.io/tools Spring Tools 4 is the next generation of Spring tooling Largely rebuilt from scratch, Spring Tools 4 provides world-class support for developing Spring-based enterprise applications, whether you prefer Eclipse, Visual Studio Code, or Theia IDE. spring.io 2. 다운로드 받은 파일을 더블클릭해서 설치합니다. 3. 바로 압축이 안 풀릴 경우 contents압출파일도 .. 2020. 8. 11.
728x90
반응형