kr.co.hit.live.web.action
Class WebApplicationContextLoader

java.lang.Object
  extended by kr.co.hit.live.web.action.WebApplicationContextLoader
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

public class WebApplicationContextLoader
extends Object
implements javax.servlet.ServletContextListener

Servlet 컨테이너가 초기화되는 시점과 Servlet 컨테이너가 중지되는 시점에 호출되는 ServletContextListener의 구현 클래스이다. 해당 ServletContext에 WebApplicatinContext 객체를 생성하여 담아 놓는다. WebApplicationContext는 Servlet 프로그램이나 WebAction 클래스에서 사용이 가능하며 ServiceContainer와 Message resources 등의 WebApplication 수행을 위한 정보를 제공한다.

web.xml 에 아래와 같이 <listener> 를 설정하여야 한다. <listener>는 web.xml 내에서 <filter-mapping>와 <servlet> 사이에 위치한다.

    <listener>
      <listener-class>kr.co.hit.live.web.action.WebApplicationContextLoader</listener-class>
    </listener>
 

WebApplicationContextLoader는 web.xml의 <context-param>를 사용하여 다음의 파라메터를 지정할 수 있다.

아래는 Context parameter을 지정하는 예시이다. <context-param> 는 <listener> 전에 정의한다.

     <context-param>
        <param-name>
           live.web.default.resource
        </param-name>
        <param-value>
            himed
        </param-value>
     </context-param>
 

Since:
4.0
Author:
김형도

Constructor Summary
WebApplicationContextLoader()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent sce)
           
 void contextInitialized(javax.servlet.ServletContextEvent sce)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebApplicationContextLoader

public WebApplicationContextLoader()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent sce)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent sce)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener


Copyright © 2014. All Rights Reserved.