}
// get the webapp context
Context context = (Context) host.findChild(realRoot);
if (context == null && "/".equals(realRoot)) { // ROOT
context = (Context) host.findChild("");
}
context.addLifecycleListener(new LifecycleListener() {
public void lifecycleEvent(LifecycleEvent event) {
Context context = (Context) event.getLifecycle();
if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {