当前位置:编程学习 > JSP >>

jsp Struts2的初始化和类的创建(1/2)

网页特效p/网页特效p.html target=_blank >jsp教程 struts2的初始化和类的创建
<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();////初始化dispatcher.
            dispatcher.getcontainer().inject(this);
            staticresourceloader.sethostconfig(new filterhostconfig(filterconfig));
        } finally {
            actioncontext.setcontext(null);
        }
    } </span>
 
 // dispatch.init():
 <span style="font-weight: normal">//这里是加载配置文件, 真正初始化struts2的action实例还没开始,
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>

1 2
补充:Jsp教程,J2ME开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,