org.ditchnet.jsp.taglib.twod.listener
Class TwoDServletContextListener

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

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

Since:
0.1

ServletContextListener that handles creating a directory named org.ditchnet.taglib.2d/ in this web app's root directory. Why do this? The <twod:canvas≷ tag generates images that can be referenced the src attributes of <img> tags. 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!

Version:
0.1
Author:
Todd Ditchendorf

Field Summary
static java.lang.String DEST_FOLDER_NAME
           
 
Constructor Summary
TwoDServletContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent evt)
           
 void contextInitialized(javax.servlet.ServletContextEvent evt)
          Creates the directory to store images later.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEST_FOLDER_NAME

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

TwoDServletContextListener

public TwoDServletContextListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent evt)
Creates the directory to store images later.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

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