Spring
-
Spring Web MVC DispatcherServletSpring 2023. 7. 9. 17:15
Spring의 웹 MVC 프레임워크는 다른 많은 웹 MVC 프레임워크와 마찬가지로 요청 중심이며 컨트롤러에 요청을 전달하고 웹 애플리케이션 개발을 가능하도록 한다. DispatcherServlet은 실제 Servlet(HttpServlet 기본 클래스에서 상속됨)이므로 웹 애플리케이션의 web.xml에서 선언된다. 동일한 web.xml 파일에서 URL 매핑을 사용하여 DispatcherServlet이 처리할 요청을 매핑해야 한다. 이것은 표준 J2EE 서블릿 구성이다. Spring Web MVC DispatcherServlet요청 처리 workflow 그림 출처: spring.io
-
JdbcSpring 2023. 7. 9. 15:09
Spring에서 지원하는 Database 입출력 관련 기능. Spring에서는 Jdbc뿐만 아니라 Orm 등 다양한 것들이 지원된다, 이를 활용해 DAO 클래스를 구현할 수 있도록 지원하고 있다. Jdbc는 JavaSe에도 있고 Spring에도 있다. 그러나 기능 차이가 있다. 아래와 같이 'JavaSe Jdbc'보다 'Spring Jdbc'가 더 많은 기능이 지원된다. JavaSe Jdbc 지원: Transaction Spring Jdbc 지원: Transaction, Multi Transaction, Connection 추상화, Connection Pool, ResultMapper, Auto close 등
-
Aop 용어Spring 2023. 7. 8. 21:59
class IMp { void myprt1(); void myprt2(); } class Mp implements IMp { void myprt1() { print("my print abc"); } void myprt2() { print2("my print cde"); } } class PrinterLog { static void log1() { print("proxy - before"); } static void log2() { print("proxy - after"); } } class MpProxy extends Mp { @Override void myprt1() { PrinterLog.Log1() Mp::myprint1(); PrinterLog.Log2() } } TargetObject 하나 또는..
-
Bean 의존 관계 주입 기초 ExSpring 2023. 7. 8. 14:30
Ex Test1Controller에 Test1Service를 의존 관계로 주입. //생성자를 통한 전달 AbstractApplicationContext ctt = new GenericXmlApplicationContext(application-config.xml”); // test1Controller 생성 Test1Controller tc1 = ctt.getBean(“test1Controller”, “Test1Controller.class”); #인스턴스가 하나만 있을 때는 이름을 명시 하지 않아도 된다 tc1.work1(); ctt.close(); // test1Controller 소멸 Ex Test1Controller에 Test1Service를 의존 관계로 주입. //test1Service1개체를 s..
-
ContainerSpring 2023. 7. 8. 06:53
개체들을 생성하고 관리 Java Spring에서는 아래와 같은 것들이 있다. FileSystemXmlApplicationContext: 파일 경로로 xml설정 파일을 로딩하는 컨테이너. ClassPathXmlApplicationContext: 클래스패스(classpath:xxx) 경로에 있는 xml설정파일을 로딩하는 컨테이너. GenericXmlApplicationContext: FileSystemXmlApplicationContext와 ClassPathXmlApplicationContext의 기능을 포함하는 컨테이너. XmlWebApplicationContext: 웹 애플리케이션 개발에 사용되지만 직접 생성하지 않는다.
-
ContextSpring 2023. 7. 8. 06:52
Springframework Bean Spring의 Context들은 개체를 생성하고 관리하는 Container 기능을 한다. Container FileSystemXmlApplicationContext: 파일 경로로 xml설정 파일을 로딩하는 컨테이너. ClassPathXmlApplicationContext: 클래스패스(classpath:xxx) 경로에 있는 xml설정파일을 로딩하는 컨테이너. GenericXmlApplicationContext: FileSystemXmlApplicationContext와 ClassPathXmlApplicationContext의 기능을 포함하는 컨테이너. XmlWebApplicationContext: 웹 애플리케이션 개발에 사용되지만 직접 생성하지 않는다. GenericX..