'태그를 입력해 주세요.'에 해당되는 글 2건

  1. 2012.08.06 [IT] jqgrid polling
  2. 2012.07.04 [java] Session Scoped Srping Bean Unit Test
2012. 8. 6. 19:12 IT


var timeoutHnd;


...

$(GRID_ID).jqGrid({

...

loadComplete: function(){

if(timeoutHnd){ // 기존 핸들은 clear

clearTimeout(timeoutHnd);

}

if( $(GRID_ID).jqGrid("getGridParam", "records")>0){ // 한건이라도 있으면.. 

timeoutHnd = setTimeout(function () { $(GRID_ID).trigger('reloadGrid'); },10000);

}

},

               ...


// has any issue?

posted by smplnote
2012. 7. 4. 11:19 IT

증상 : 

Spring의 SpringJUnit4ClassRunner 클래스를 이용하여 Session Scope로 정의한 Bean을 테스트하려고 할때 

아래와 같은 에러가 발생함.


java.lang.IllegalStateException : No Scope registered for scope 'session' 


solution : session scope을 처리하는 bean을 SimpleThreadScope 으로 바꿔치기하면 됨 


test용 context.xml 에 다음을 추가. 


<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
    <property name="scopes">
        <map>
            <entry key="session">
                <bean class="org.springframework.context.support.SimpleThreadScope"/>
            </entry>
        </map>
    </property>
</bean>


reference : http://blog.solidcraft.eu/2011/04/how-to-test-spring-session-scoped-beans.html



posted by smplnote