본문 바로가기

Programming/Spring28

Spring3.0 기본 셋팅 Welcome to the Part 2 of Spring 3.0 MVC Series. In previous article we went through the Introduction of Spring MVC 3.0 framework, its request processing lifecycle and architecture diagram. In this article, let us create a simple Hello World application in Spring MVC 3.0.For creating the hello world demo application, we will use Eclipse IDE. Spring 3.0 MVC SeriesPart 1: Introduction to Spring 3.0.. 2013. 1. 16.
PathVariable 어노테이션을 이용한 URI 템플릿 즉.xxxx/xxxx/info?user=id 형태의 url이 있다면 --> xxxx/xxxx/info/user/id .. 뭐 이런것 처럼 파라미터가 uri에 포함되도록 하는 형태란다. 이걸 스프링3 에서 흉내?? 낼수 있는데 URI 템플릿 기능이란다. 1. 설정방법 방법은 @RequestMapping 어노테이션값으로 { 템플릿변수 } 를 사용한다. @PathVariable 어노테이션을 이용해서 { 템플릿 변수 } 와 동일한 이름을 갖는 파라미터를 추가한다. @Controller public class CharacterInfoController { @RequestMapping( "/game/users/{userId}/characters/{characterId}" ) public String characte.. 2012. 10. 11.
Mybatis Mapper mapper : ibatis의 SqlMap namespace : 자바 Interface의 패키지명 (이파일이 해당 경로에 있을 필요는 없다. 하지만 스프링에서 Interface와 mapper.xml 이 같은 패키지에 있으면 mapper.xml의 경로를 별도로 등록 하지 않고서 자동으로 연결 해주는 듯 하다.) 2012. 9. 28.
Spring Annotation - @Component, @Service, @Repository, @Controller Spring 2.5 가 되면서 dependency injection 관련해서 서비스 구성이 무지 편해졌다. annotation 을 통해서 빈들을 지정된 클래스패스에서 자동으로 인식하게 할수 있게 되었고, 필요자원을 세팅시킬수 있게 되었다. 넘 편리~~ Stereotype-annotation(@Component, @Service, @Repository, @Controller) 을 통해서 자동으로 클래스패스에서 컴포넌트를 인식(auto-detect) 시킬수 있다. @Component는 자동인식이 되는 일반 컴퍼넌트로 다른 녀석들의 부모역할을 한다. @Service는 비즈니스 서비스를 의미하고, @Repository는 Dao 에 적용하면 좋은 녀석인데, DB Exception Translation을 자동으로 .. 2012. 9. 28.