net.sourceforge.wurfl.core.web
Class WURFLServletContextListener

java.lang.Object
  extended by net.sourceforge.wurfl.core.web.WURFLServletContextListener
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener, WurflWebConstants

public class WURFLServletContextListener
extends Object
implements javax.servlet.ServletContextListener, WurflWebConstants

ServletContextListener instantiating WURFLHolder.

This class permit to instantiate WURFL at servlet context loading time:

  <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 
        <context-param>
                <param-name>wurfl</param-name>
                <param-value>/WEB-INF/wurfl.zip</param-value>
        </context-param>
        
  <context-param>
                <param-name>wurflPatch</param-name>
                <param-value>/WEB-INF/wb_patch.xml,/WEB-INF/other_patch.xml</param-value>
        </context-param>
 
        <context-param> 
                <param-name>wurflLazy</param-name>
                <param-value>true</param-value>
        </context-param>
 
        <!-- the ServletContext key against store the wurflHolder. This is default --> 
        <context-param> 
                <param-name>wurflHolderKey</param-name>
                <param-value>net.sourceforge.wurfl.core.WURFLHolder</param-value>
        </context-param>
 
        <listener>
                <listener-class>
                net.sourceforge.wurfl.core.web.WURFLServletContextListener 
                </listener-class>
        </listener>
 
  </web-app>
 

Version:
$Id: WURFLServletContextListener.java 934 2012-03-27 13:34:26Z fulvio.crivellaro $

Field Summary
 
Fields inherited from interface net.sourceforge.wurfl.core.web.WurflWebConstants
WURFL, WURFL_DEFAULT_LOCATION, WURFL_HOLDER_KEY, WURFL_HOLDER_KEY_PARAM, WURFL_PATCH
 
Constructor Summary
WURFLServletContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
           
 void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WURFLServletContextListener

public WURFLServletContextListener()
Method Detail

contextInitialized

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

contextDestroyed

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


Copyright © 2012 ScientiaMobile Inc.. All Rights Reserved.