#filter');-webkit-filter:blur(1rem);filter:blur(1rem)}.container{padding:0 20px;max-width:100%;margin:0 auto}@media only screen and (min-width:36em){.container{max-width:540px;margin:0 auto}}@media only screen and (min-width:48em){.container{max-width:720px;margin:0 auto}}@media only screen and (min-width:62em){.container{max-width:960px;margin:0 auto}}@media only screen and (min-width:75em){.container{max-width:1170px;margin:0 auto}}.header{background-color:#fff;color:#343851;position:absolute;z-index:4;width:100%;top:0;left:0;will-change:transform;-webkit-transform:translateY(0);transform:translateY(0)}.header a{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:0}.header__logo{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;overflow:hidden;padding:19px 0;margin-right:1.25rem;outline:0;border-bottom:0;color:#313237}.header__logo .header__logo--container{width:58px}.header__logo .header__logo--container .logo{fill:currentColor}.header__inner{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:3.75em;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.header__links{padding-bottom:.5rem;display:none;position:absolute;top:3.75em;left:0;width:100%;height:auto;background:#fff}.header__link{color:#343851;padding:.938rem 0;border-top:1px solid #ededed}.header__toggle{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:44px;height:100%;background-color:transparent;padding-left:1.25rem}.header__toggle span{display:block;position:relative;margin-top:4px;background-color:#343851;width:100%;height:2px;border-radius:1px}.header__toggle span:first-child{margin-top:0}@media (min-width:62em){.header__toggle{display:none;visibility:hidden}.header__links{position:static;padding:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;visibility:visible;width:auto;height:100%}.header__links-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;padding:0}.header__link{position:relative;padding:.938rem 1rem;border:0;height:100%}.header__link::after{content:"";display:block;position:absolute;left:0;bottom:0;height:3px;width:100%;-webkit-transform:scaleX(0);transform:scaleX(0);background:#277cea}}.post-card{display:block;position:relative;width:100%;min-height:250px;border-radius:4px;overflow:hidden;background-color:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.08);box-shadow:0 1px 3px rgba(0,0,0,.08);margin-bottom:2.25rem;border-bottom:0}@media only screen and (min-width:48em){.post-card{width:48.4375%;margin-right:3.125%}.post-card:nth-child(2n+2){margin-right:0}}@media only screen and (min-width:75em){.post-card{width:31.25%;margin-right:3.125%}.post-card:nth-child(2n+2){margin-right:3.125%}}.post-card__label{position:absolute;top:1.5rem;left:1.5rem;z-index:2}.post-card__inner{display:block;position:relative;padding:1.875rem 1.25rem .625rem;width:100%;color:#838c8d;border-bottom:0}.post-card__header{margin-bottom:.75rem}.post-card__meta{font-size:.875rem}.post-card__thumb{margin:0;background:#fff;position:relative;overflow:hidden}.post-card__thumb::after{content:"";display:block;height:0;width:100%;padding-bottom:56.25%}.post-card__thumb>*{position:absolute;top:0;left:0;width:100%;height:100%;display:block}.label{padding:0 10px;margin-bottom:1rem;display:inline-block;line-height:20px;font-size:.75rem;text-transform:uppercase;letter-spacing:1px;color:rgba(255,255,255,.8);border:2px solid rgba(255,255,255,.5);border-radius:100px}.hero{margin:3.75rem auto 0;min-height:16.25rem;width:100%;position:relative;background-color:#dde5ea;background-repeat:no-repeat;background-position:50%;background-size:cover}@media only screen and (min-width:62em){.hero{margin:0 auto;height:36em}}.hero::before{position:absolute;display:block;content:"";top:0;left:0;width:100%;height:100%;background:rgba(52,56,81,.8)}.hero__wrap{position:absolute;margin:auto;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;color:rgba(255,255,255,.8);width:100%;max-width:90%;z-index:1}.hero__wrap .hero__title{font-size:1.8em;color:#fff}.blog{background-color:#f9f9f9}.post-list{padding-top:2.5em;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}@media only screen and (min-width:48em){.hero__wrap{max-width:40em}.hero__wrap .hero__title{padding:1rem 0;font-size:2.625em;line-height:3.125rem}.post-list{padding-top:5em}}
spring-core : 스프링의 핵심인 DI(Dependency Injection)와 IoC(Inversion of Control)를 제공
spring-aop : AOP구현 기능 제공
spring-jdbc : 데이터베이스를 쉽게(적은 양의 코드) 다룰 수 있는 기능 제공
spring-tx : 스프링에서 제공하는 트랜잭션 관련 기능 제공
spring-webmvc : 스프링에서 제공하는 컨트롤러(Controller)와 뷰(View)를 이용한 스프링MVC 구현 기능 제공
스프링 컨테이너(IoC)
스프링에서 객체를 생성하고 조립하는 컨테이너(container)로, 컨테이너를 통해 생성된 객체를 빈(Bean)이라고 부름
스프링-프레임워크
개발-환경-구축
폴더 및 pom.xml 파일 이해
pjt project : 스프링 프로젝트
pjt/src/main/java : .java 파일 관리
앞으로 만들어지는 자바 파일들이 관리되는 폴더이
pjt/src/main/resources : 자원파일 관리
스프링 설정 파일(XML) 또는 프로퍼티 파일 등이 관리
pom.xml 파일은 메이븐 설정파일로 메이븐은 라이브러리를 연결해주고, 빌드를 위한 플랫폼
pom.xml에 의해서 필요한 라이브러리만 다운로드 해서 사용
프로젝트-생성
test
스프링 방식의 ‘의존’을 이용하기 위해서는 Main에서 TransportationWalk 객체를 직접 생성하지 않고, 스프링 설정 파일(XML)을 이용
가장 큰 차이점은 Java 파일에서 이용한 new 연산자를 이용하지 않고 스프링 설정파일(XML)을 이용
스프링 설정 파일(applicationContext.xml)에 Bean tag로 명시된 tag들이
GenericXmlApplicationContext class에 의해
Spring Containr 안에 객체로 생성
DI가 적용된 객체들도 존재
이렇게 생성된 Bean 객체들은 getBean() method로 사용
<?xml version="1.0" encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"><!-- 객체(Bean) 등록 --><beanid="tWalk"class="lec03Pjt001.TransportationWalk"/></beans>
packagelec03Pjt001;importorg.springframework.context.support.GenericXmlApplicationContext;publicclassMainClass{publicstaticvoidmain(String[]args){/////////////////////////일반 java framework///////////////////////// TransportationWalk transportationWalk = new TransportationWalk();// transportationWalk.move();/////////////////////////spring framework///////////////////////// xml 파일을 이용하여 객체를 생성/*
1. Spring Container 생성
xml을 사용하므로 GenericXmlApplicationContext class 를 사용
이 class를 생성할 때, 그 안쪽에 리소스(xml)의 내용을 작성.
*/GenericXmlApplicationContextctx=newGenericXmlApplicationContext("classpath:applicationContext.xml");/*
컨테이너에서 어떠한 객체를 가져올지 ID와 dataType 을 작성
*/TransportationWalktransportationWalk=ctx.getBean("tWalk",TransportationWalk.class);transportationWalk.move();// 외부 자원은 반환하여 리소스를 남기지 않도록 해준다.ctx.close();}}