Web effects phttp://www.111cn.net/Web effects p.html target=_blank >jsp Tutorials struts2 Initialization and class creation
<span style= "Font-weight:normal" > Public Xmlconfigurationprovider () {
This ("Xwork.xml", true);
}</span>
<span style= "Font-weight:normal" >public class Strutsxmlconfigurationprovider
Extends Xmlconfigurationprovider {
Public Strutsxmlconfigurationprovider (Boolean errorifmissing)
{
This ("Struts.xml", errorifmissing, NULL);
}
... </span>
Filterdispatch.init ():
<span style= "Font-weight:normal" >public void init (Filterconfig filterconfig)
Throws Servletexception {
try {
This.filterconfig = Filterconfig;
Initlogging ();
Dispatcher = Createdispatcher (Filterconfig);
Dispatcher.init ();////Initialize dispatcher.
Dispatcher.getcontainer (). inject (this);
Staticresourceloader.sethostconfig (New Filterhostconfig (Filterconfig));
finally {
Actioncontext.setcontext (NULL);
}
} </span>
Dispatch.init ():
<span style= "Font-weight:normal" >//here is the load configuration file, the real initialization of the STRUTS2 action instance has not started,
public void init () {
if (ConfigurationManager = = null) {
ConfigurationManager =
New ConfigurationManager (Beanselectionprovider.default_bean_name);
}
Init_defaultproperties (); [1]
Init_traditionalxmlconfigurations (); [2]
Init_legacystrutsproperties (); [3]
Init_customconfigurationproviders (); [5]
Init_filterinitparameters (); [6]
Init_aliasstandardobjects (); [7]
Container container = Init_preloadconfiguration ();
Container.inject (this);
Init_checkconfigurationreloading (container);
Init_checkweblogicworkaround (container);
if (!dispatcherlisteners.isempty ()) {
for (Dispatcherlistener l:dispatcherlisteners) {
L.dispatcherinitialized (this);
}
}
} </span>