org.ditchnet.jsp.taglib.tabs.listener
Class TabServletContextListener

java.lang.Object
  extended byorg.ditchnet.jsp.taglib.tabs.listener.TabServletContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class TabServletContextListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

Since:
0.8

ServletContextListener that handles extracting CSS, JavaScript, and image resource files from this taglib's JAR file, and places them in a directory called org.ditchnet.taglib/ in this web app's root directory. Why do this? The HTML files in which the tabs are used must have access to the CSS, JavaScript and image files that render the tabs correctly. Therefore, they must be placed in a known location outside of the WEB-INF directory so that client browsers can access them.

By implementing this feature as as ServletContextListener, These resources are deployed immediately on reloading your web app, and are therefore available before the first request!

Author:
Todd Ditchendorf

Field Summary
static java.lang.String SCRIPT_URI
           
static java.lang.String STYLE_URI
           
 
Constructor Summary
TabServletContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent evt)
           
 void contextInitialized(javax.servlet.ServletContextEvent evt)
          Handles finding all CSS, JavaScript, and image resources from this taglib's JAR file and copies them to a directory in the web app's root directory where the tab components can link to them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCRIPT_URI

public static final java.lang.String SCRIPT_URI
See Also:
Constant Field Values

STYLE_URI

public static final java.lang.String STYLE_URI
See Also:
Constant Field Values
Constructor Detail

TabServletContextListener

public TabServletContextListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent evt)
Handles finding all CSS, JavaScript, and image resources from this taglib's JAR file and copies them to a directory in the web app's root directory where the tab components can link to them.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

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