Lifecyclelistener Tomcat Example
Public static interface ExtendedBeanManager.LifecycleListener Contract for things interested in receiving notifications of BeanManager lifecycle events. A 'beanManagerDestroyed' notifications would probably also be generally useful, although we do not need it here and not sure WildFly can really tell us that reliably. The LifecycleListener is a ContextConfig that has a default web.xml configured that should prevent the JSPServlet from being loaded. Gns3 cloud configuration. Other than expected, it turns out that addWebapp actively ignores the configured default web.xml and Tomcat instead loads statically hard-coded default configuration that includes the JSPServlet and servlet.
Tomcat Lifecycle Listener
Here you are the code. thanks..
public void init() {
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate='collapsed' desc='Managed Component Initialization'>
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log('Page1 Initialization Failure', e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
this.label1.setText('New Value !!!');
}
As you see, the bold italic line is the only modification that I do..
default value of text of label1 is 'Label1'.
Then when run the application, the result is 'Label1' not 'New Value !!!'
That's it
public void init() {
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate='collapsed' desc='Managed Component Initialization'>
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log('Page1 Initialization Failure', e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
this.label1.setText('New Value !!!');
}
As you see, the bold italic line is the only modification that I do..
default value of text of label1 is 'Label1'.
Then when run the application, the result is 'Label1' not 'New Value !!!'
That's it