검색결과 리스트
springframework에 해당되는 글 16건
- 2015.07.21 [egovFrame] @Aspect 예제
- 2015.07.17 [Spring] SPRING BOOT CONFIGURATIONPROPERTIES AND PROFILE MANAGEMENT USING YAML
- 2015.07.15 [Spring] Spring JavaConfig Reference Guide
- 2014.06.01 [ehcache] Springframework에 Ehcache 적용하기
- 2014.04.19 [Spring] Tomcat 7 환경에서 JNDI DataSource + Spring 연동 방법
- 2014.03.26 [Spring] servlet context와 root context의 component-scan의 미묘한 차이점 (잘못하면 404 에러뜸)
- 2014.03.25 [Spring] Spring-data Redis
- 2014.01.07 [Tiles] 스프링을 이용한 Tiles 에 EL 및 Wildcard 연동
- 2013.12.18 [Spring] Spring 3.1 + Redis 를 이용한 Cache
- 2013.12.16 [Spring] 객체 검증의 종결자 @Valid
- 2013.11.20 [Spring] spring-data-mongodb Sample
- 2013.08.20 [SpringSecurity] Spring Security Full ACL Tutorial
- 2013.08.08 [SpringSecurity] SpringSecurity 3
- 2013.07.29 [Spring] Commons configuration을 사용한 스프링 운영 환경 설정값 지정
- 2013.04.05 [Spring] Spring Tiles
- 2013.04.03 [Spring] 스프링 버전 확인하기
글
글
[Spring] SPRING BOOT CONFIGURATIONPROPERTIES AND PROFILE MANAGEMENT USING YAML
설정
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Spring 3.1 M2: Testing with @Configuration Classes and Profiles (0) | 2015.07.21 |
---|---|
[Spring] Advanced Spring Data JPA - Specifications and Querydsl (0) | 2015.07.21 |
[Spring] Spring JavaConfig Reference Guide (0) | 2015.07.15 |
[Spring] Tomcat 7 환경에서 JNDI DataSource + Spring 연동 방법 (0) | 2014.04.19 |
[Spring] servlet context와 root context의 component-scan의 미묘한 차이점 (잘못하면 404 에러뜸) (0) | 2014.03.26 |
트랙백
댓글
글
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Advanced Spring Data JPA - Specifications and Querydsl (0) | 2015.07.21 |
---|---|
[Spring] SPRING BOOT CONFIGURATIONPROPERTIES AND PROFILE MANAGEMENT USING YAML (0) | 2015.07.17 |
[Spring] Tomcat 7 환경에서 JNDI DataSource + Spring 연동 방법 (0) | 2014.04.19 |
[Spring] servlet context와 root context의 component-scan의 미묘한 차이점 (잘못하면 404 에러뜸) (0) | 2014.03.26 |
[Spring] Spring-data Redis (0) | 2014.03.25 |
트랙백
댓글
글
'Java > ehcache' 카테고리의 다른 글
[ehcache] Using Hibernate and BigMemory Go (0) | 2014.12.08 |
---|---|
[ehcache] EHCache를 이용한 캐시 구현 (0) | 2014.03.18 |
트랙백
댓글
글
'Java > SpringFramework' 카테고리의 다른 글
[Spring] SPRING BOOT CONFIGURATIONPROPERTIES AND PROFILE MANAGEMENT USING YAML (0) | 2015.07.17 |
---|---|
[Spring] Spring JavaConfig Reference Guide (0) | 2015.07.15 |
[Spring] servlet context와 root context의 component-scan의 미묘한 차이점 (잘못하면 404 에러뜸) (0) | 2014.03.26 |
[Spring] Spring-data Redis (0) | 2014.03.25 |
[Spring] SpringFramework 3.2.6.RELEASE format-configuring-formatting-mvc (0) | 2014.01.22 |
트랙백
댓글
글
[Spring] servlet context와 root context의 component-scan의 미묘한 차이점 (잘못하면 404 에러뜸)
설정
설명보다 제목적기가 더 힘들다.
Bean을 일일이 설정하기 힘들기 때문에 SpringMVC에서는 MVC 구분에 맞춰서
@Controller, @Service, @Repository가 있다. 또한 이와 관계없이 @Component 어노테이션이 존재한다.
나는 보통 @Controller는 servlet context에 설정하고
@Service, @Repository, @Component는 root context에 설정한다.
그래서 servlet-context에 아래와 같이 설정했다.
<context:component-scan base-package="com.ddoong2">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository" />
</context:component-scan>
그리고 root-context에는 다음과 같이 설정했다.
<context:component-scan base-package="com.ddoong2">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Service" />
<context:include-filter type="annotation" expression="org.springframework.stereotype.Repository" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
그런데 이번에 @Component 어노테이션을 사용할 일이 있어서 사용했더니 이개 두번 생성된다.
servlet context와 root context에서 같이 생성되는 현상이 발생했다.
그래서 servlet context를 아래와 같이 설정했다.
<context:component-scan base-package="com.ddoong2">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Component" />
</context:component-scan>
그랬더니 페이지를 찾을 수 없다는 404에러가 발생했다.
원인은 컨트롤러 빈이 로딩이 되지 않는것이였다.
원인을 찾아보니 @Controller 어노테이션의 소스에서 찾았다.
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface Controller {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
* @return the suggested component name, if any
*/
String value() default "";
}
Controller 어노테이션이 Component 어노테이션을 사용하고 있는 것
그리고 최종으로 아래와 같이 수정해서 해결했다.
servlet context
<context:component-scan base-package="com.ddoong2" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
root context
<context:component-scan base-package="com.ddoong2" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Service" />
<context:include-filter type="annotation" expression="org.springframework.stereotype.Repository" />
<context:include-filter type="annotation" expression="org.springframework.stereotype.Component" />
</context:component-scan>
component-scan의 프로퍼티중에 use-default-filters의 기본값은 true 이다.
이 부분을 false로 하고 설정을 하면 다른 필터는 로딩되지 않고 순수하게 설정된 부분만 필터링이된다.
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Spring JavaConfig Reference Guide (0) | 2015.07.15 |
---|---|
[Spring] Tomcat 7 환경에서 JNDI DataSource + Spring 연동 방법 (0) | 2014.04.19 |
[Spring] Spring-data Redis (0) | 2014.03.25 |
[Spring] SpringFramework 3.2.6.RELEASE format-configuring-formatting-mvc (0) | 2014.01.22 |
[Spring] Creating RESTful services, HiddenHttpMethodFilter (0) | 2014.01.21 |
트랙백
댓글
글
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Tomcat 7 환경에서 JNDI DataSource + Spring 연동 방법 (0) | 2014.04.19 |
---|---|
[Spring] servlet context와 root context의 component-scan의 미묘한 차이점 (잘못하면 404 에러뜸) (0) | 2014.03.26 |
[Spring] SpringFramework 3.2.6.RELEASE format-configuring-formatting-mvc (0) | 2014.01.22 |
[Spring] Creating RESTful services, HiddenHttpMethodFilter (0) | 2014.01.21 |
[Spring] Validation (0) | 2014.01.21 |
트랙백
댓글
글
글
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Creating RESTful services, HiddenHttpMethodFilter (0) | 2014.01.21 |
---|---|
[Spring] Validation (0) | 2014.01.21 |
[Spring] 객체 검증의 종결자 @Valid (0) | 2013.12.16 |
[Spring] spring-data-mongodb Sample (0) | 2013.11.20 |
[Spring] Commons configuration을 사용한 스프링 운영 환경 설정값 지정 (0) | 2013.07.29 |
트랙백
댓글
글
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Validation (0) | 2014.01.21 |
---|---|
[Spring] Spring 3.1 + Redis 를 이용한 Cache (0) | 2013.12.18 |
[Spring] spring-data-mongodb Sample (0) | 2013.11.20 |
[Spring] Commons configuration을 사용한 스프링 운영 환경 설정값 지정 (0) | 2013.07.29 |
[Spring] JSON 마샬링, 언마샬링 (0) | 2013.07.22 |
트랙백
댓글
글
링크 : http://www.sjune.net/archives/431
링크 : https://github.com/sjune/spring-example-mongodb
MongDB 소개 자료(최범균) : http://javacan.tistory.com/entry/MongoDB-%EC%86%8C%EA%B0%9C-%ED%8C%80%EB%82%B4-%EB%B0%9C%ED%91%9C-%EC%9E%90%EB%A3%8C
Hibernate with MongoDB : http://docs.jboss.org/hibernate/ogm/4.0/reference/en-US/html_single/#ogm-mongodb
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Spring 3.1 + Redis 를 이용한 Cache (0) | 2013.12.18 |
---|---|
[Spring] 객체 검증의 종결자 @Valid (0) | 2013.12.16 |
[Spring] Commons configuration을 사용한 스프링 운영 환경 설정값 지정 (0) | 2013.07.29 |
[Spring] JSON 마샬링, 언마샬링 (0) | 2013.07.22 |
[Spring] Spring Tiles (0) | 2013.04.05 |
트랙백
댓글
글
'Java > SpringSecurity' 카테고리의 다른 글
[SpringSecurity] Spring Security Java Config (0) | 2015.08.04 |
---|---|
[SpringSecurity] SpringSecurity Multiple Login Forms 만들기 (0) | 2014.04.18 |
[SpringSecurity] 중복 로그인 제거 (0) | 2014.04.10 |
[SpringSecurity] 스프링 시큐리티, 어디까지 만지작 거릴수 있을까? (0) | 2013.11.23 |
[SpringSecurity] SpringSecurity 3 (0) | 2013.08.08 |
트랙백
댓글
글
Spring Security Tutorial : http://static.springsource.org/spring-security/site/tutorial.html
Spring Security를 이용한 인증 처리 : http://preludeb.egloos.com/4738521
1장 스프링 시큐리티란? : http://springmvc.egloos.com/504862
2장 Intercept와 Granted Authority : http://springmvc.egloos.com/506465
3장 데이터베이스로 이동하는 Authentication 정보 : http://springmvc.egloos.com/516241
4장 JdbcDaoImpl의 커스터마이징. : http://springmvc.egloos.com/518902
5장 스프링 시큐리티에서의 비밀번호 암호화 : http://springmvc.egloos.com/520257
'Java > SpringSecurity' 카테고리의 다른 글
[SpringSecurity] Spring Security Java Config (0) | 2015.08.04 |
---|---|
[SpringSecurity] SpringSecurity Multiple Login Forms 만들기 (0) | 2014.04.18 |
[SpringSecurity] 중복 로그인 제거 (0) | 2014.04.10 |
[SpringSecurity] 스프링 시큐리티, 어디까지 만지작 거릴수 있을까? (0) | 2013.11.23 |
[SpringSecurity] Spring Security Full ACL Tutorial (0) | 2013.08.20 |
트랙백
댓글
글
'Java > SpringFramework' 카테고리의 다른 글
[Spring] 객체 검증의 종결자 @Valid (0) | 2013.12.16 |
---|---|
[Spring] spring-data-mongodb Sample (0) | 2013.11.20 |
[Spring] JSON 마샬링, 언마샬링 (0) | 2013.07.22 |
[Spring] Spring Tiles (0) | 2013.04.05 |
[Spring] 스프링 버전 확인하기 (0) | 2013.04.03 |
트랙백
댓글
글
링크 : http://blog.naver.com/artfile?Redirect=Log&logNo=130160553266
stucts에서 처음 타일즈를 써봤는데 공통 부분을 모듈화 해서 관리하는 점은 편했는데
관리파일이 하나의 xml이어서 공동작업시 불편했다.
스프링에서 제공하는 클래스를 이용하면 분산 설정이 가능하다.
'Java > SpringFramework' 카테고리의 다른 글
[Spring] Commons configuration을 사용한 스프링 운영 환경 설정값 지정 (0) | 2013.07.29 |
---|---|
[Spring] JSON 마샬링, 언마샬링 (0) | 2013.07.22 |
[Spring] 스프링 버전 확인하기 (0) | 2013.04.03 |
[Spring] Spring - Quartz를 사용하여 스케줄러 구현하기 (0) | 2012.11.29 |
[Spring] Spring MVC에서 한글 처리 (0) | 2012.07.20 |
트랙백
댓글
글
// 스프링 버전 확인하기
org.springframework.core.SpringVersion.getVersion()
'Java > SpringFramework' 카테고리의 다른 글
[Spring] JSON 마샬링, 언마샬링 (0) | 2013.07.22 |
---|---|
[Spring] Spring Tiles (0) | 2013.04.05 |
[Spring] Spring - Quartz를 사용하여 스케줄러 구현하기 (0) | 2012.11.29 |
[Spring] Spring MVC에서 한글 처리 (0) | 2012.07.20 |
[Spring] Springframework 2.5 fileupload (0) | 2012.07.04 |
RECENT COMMENT