블로그 이미지
윤영식
Full Stacker, Application Architecter, KnowHow Dispenser and Bike Rider

Publication

Category

Recent Post

2013. 5. 29. 14:16 Middleware, Cloud/WAS

제이보스에서 버전별 Session 객체의 타임아웃 설정하는 곳은 어디일까?


1. 버전별 설정 위치 

  - 기본 설정사항 

JBoss 6.x

deploy/jbossweb.sar/web.xml

JBoss 5

deployers/jbossweb.deployer/web.xml

JBoss 4.3
deploy/jboss-web.deployer/conf/web.xml
Earlier versions

deploy/jbossweb-tomcat55.sar/conf/web.xml


    <!-- ==================== Default Session Configuration ================= -->

   <!-- You can set the default session timeout (in minutes) for all newly   -->
   <!-- created sessions by modifying the value below.                       -->

   <session-config>
      <session-timeout>30</session-timeout>
   </session-config>



2. 재설정 방법

  - 컨텍스트별 설정 변경

  - WEB-INF/web.xml 에 동일 태그로 설정한다.  (단위, min)

  - 값이 0 이면 영구적으로 보관 즉, WAS 재기동전까지...

Add the same tags as above to WEB-INF/web.xml.  Here is the DTD for further explanation:

<!--
The session-config element defines the session parameters for
this web application.

Used in: web-app
-->
<!ELEMENT session-config (session-timeout?)>

<!--
The session-timeout element defines the default session timeout
interval for all sessions created in this web application. The
specified timeout must be expressed in a whole number of minutes.
If the timeout is 0 or less, the container ensures the default
behaviour of sessions is never to time out.

Used in: session-config
--> 

<!ELEMENT session-timeout (#PCDATA)>


  - 또는 애플리케이션에서 호출해도 된다. 

    + 만일 web.xml 설정을 해도 제대로 동작되지 않으면 하드코딩 되어 있는지 확인한다 (참조1 , 참조2)

    + 해당 코드를 넣으면 전역으로 반영이 된다

HttpSession.setMaxInactiveInterval(int seconds)



<참조>

  - 원문 : 세션 Timeout 설정

  - 세션 Timeout 설정하기 정리

posted by 윤영식