[egovFrame] @Aspect 예제

Java/egovFrame 2015. 7. 21. 11:24

링크: http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte:fdl:aop:aspectj

'Java > egovFrame' 카테고리의 다른 글

[egovFrame] 전자정부 표준프레임워크  (0) 2012.01.26
posted by 뚱2
posted by 뚱2

링크: http://docs.spring.io/spring-javaconfig/docs/1.0.0.M4/reference/html/

posted by 뚱2

링크: http://blog.naver.com/kdi85?Redirect=Log&logNo=30174077362

'Java > ehcache' 카테고리의 다른 글

[ehcache] Using Hibernate and BigMemory Go  (0) 2014.12.08
[ehcache] EHCache를 이용한 캐시 구현  (0) 2014.03.18
posted by 뚱2

링크: http://beyondj2ee.tumblr.com/post/14508592466/tomcat-7-jndi-datasource-spring

posted by 뚱2

설명보다 제목적기가 더 힘들다.


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로 하고 설정을 하면 다른 필터는 로딩되지 않고 순수하게 설정된 부분만 필터링이된다.

posted by 뚱2

링크: http://blog.softwareinlife.com/2013/05/building-applications-with-spring-data.html

posted by 뚱2

링크 : http://slothink.tistory.com/117

'Java > Tiles' 카테고리의 다른 글

[Tiles] Tiles Documentation  (0) 2014.01.07
posted by 뚱2

링크 : http://debop.blogspot.kr/2013/03/spring-31-redis-cache.html

posted by 뚱2

링크 : http://springmvc.egloos.com/509029

posted by 뚱2

링크 : 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

 

posted by 뚱2

링크 : http://krams915.blogspot.kr/2011/01/spring-security-3-full-acl-tutorial.html

posted by 뚱2

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

 

 

 

 

 

posted by 뚱2

링크 : http://valley.egloos.com/viewer/?url=http://gyumee.egloos.com/1471952 

 

 

'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
posted by 뚱2

[Spring] Spring Tiles

Java/SpringFramework 2013. 4. 5. 23:08

링크 : http://blog.naver.com/artfile?Redirect=Log&logNo=130160553266 

 

stucts에서 처음 타일즈를 써봤는데 공통 부분을 모듈화 해서 관리하는 점은 편했는데

 

관리파일이 하나의 xml이어서 공동작업시 불편했다.

 

스프링에서 제공하는 클래스를 이용하면 분산 설정이 가능하다.

 

 

 

posted by 뚱2

 

// 스프링 버전 확인하기

org.springframework.core.SpringVersion.getVersion() 

posted by 뚱2