THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Use a DispatcherListener to get hooked up to event object to execute code when a Struts2 Dispatcher gets is initalized and or destroyed. This is a useful place A DispatcherListener is an easy way to associate customizable components like a ConfigurationManager with a Dispatcher.
Example
Code Block |
---|
static { Dispatcher.addDispatcherListener(new DispatcherListener() { public void dispatcherInitialized(Dispatcher du) { // do something to Dispatcher after it is initialized eg. du.setConfigurationManager(....); } public void dispatcherDestroyed(Dispatcher du) { // do some cleanup after Dispatcher is destroyed. } }); } |