zoukankan      html  css  js  c++  java
  • strut2的原理

    Struts2 在项目中用到的核心是拦截器interceptor,OGNL(Object Graph navigation Language)对象图导航语言(用来操作ValueStack里面的数据),Value Stack和ActionContext。strut2是基于WebWork,WebWork致力于组件化和代码重用,使用MVC设计模式。struts2拥有了WebWork的这些优点。 Struts2是以Webwork的设计思想为核心,吸收了Struts1的优点,因此,可以认为Struts2是Struts1和Webwork结合的产物。

     

    Struts2和struts1的比较

        struts2相对于struts1来说简单了很多,并且功能强大了很多,我们可以从几个方面来看:

        从体系结构来看:struts2大量使用拦截器来出来请求,从而允许与业务逻辑控制器 与 servlet-api分离,避免了侵入性;而struts1.x在action中明显的侵入了servlet-api.

        从线程安全分析:struts2.x是线程安全的,每一个对象产生一个实例,避免了线程安全问题;而struts1.x在action中属于单线程。

        性能方面:struts2.x测试可以脱离web容器,而struts1.x依赖servlet-api,测试需要依赖web容器。

        请求参数封装对比:struts2.x使用ModelDriven模式,这样我们 直接 封装model对象,无需要继承任何struts2的基类,避免了侵入性。

        标签的优势:标签库几乎可以完全替代JSTL的标签库,并且 struts2.x支持强大的ognl表达式。

        当然,struts2和struts1相比,在 文件上传,数据校验 等方面也 方便了好多。在这就不详谈了。

     

    这是Struts2官方站点提供的Struts 2 的整体结构。
    一个请求在Struts2框架中的处理大概分为以下几个步骤

    1.     客户端提起一个(HttpServletRequest)请求,如上文在浏览器中输入”http://localhost:8080/TestMvc/add.action”就是提起一个(HttpServletRequest)请求。

    2.     请 求被提交到一系列(主要是三层)的过滤器(Filter),如(ActionContextCleanUp、其他过滤器(SiteMesh等)、 FilterDispatcher(StrutsPrepareAndExecuteFilter))。注意这里是有顺序的,先ActionContextCleanUp,再其他过滤器(SiteMesh等)、最后到 FilterDispatcher。

    3.     FilterDispatcher是控制器的核心,就是mvc中c控制层的核心。下面粗略的分析下我理解的FilterDispatcher工作流程和原理:

    FilterDispatcher进行初始化并启用核心doFilter
    其代码如下:
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
            HttpServletRequest request = (HttpServletRequest) req;
            HttpServletResponse response = (HttpServletResponse) res;
            ServletContext servletContext = filterConfig.getServletContext();
            // 在这里处理了HttpServletRequest和HttpServletResponse。
            DispatcherUtils du = DispatcherUtils.getInstance();
            du.prepare(request, response);//正如这个方法名字一样进行locale、encoding以及特殊request parameters设置
            try {
                request = du.wrapRequest(request, servletContext);//对request进行包装
            } catch (IOException e) {
                String message = "Could not wrap servlet request with MultipartRequestWrapper!";
                LOG.error(message, e);
                throw new ServletException(message, e);
            }
                    ActionMapperIF mapper = ActionMapperFactory.getMapper();//得到action的mapper
            ActionMapping mapping = mapper.getMapping(request);// 得到action 的 mapping
            if (mapping == null) {
                // there is no action in this request, should we look for a static resource?
                String resourcePath = RequestUtils.getServletPath(request);
                if ("".equals(resourcePath) && null != request.getPathInfo()) {
                    resourcePath = request.getPathInfo();
                }
                if ("true".equals(Configuration.get(WebWorkConstants.WEBWORK_SERVE_STATIC_CONTENT)) 
                        && resourcePath.startsWith("/webwork")) {
                    String name = resourcePath.substring("/webwork".length());
                    findStaticResource(name, response);
                } else {
                    // this is a normal request, let it pass through
                    chain.doFilter(request, response);
                }
                // WW did its job here
                return;
            }
            Object o = null;
            try {
                //setupContainer(request);
                o = beforeActionInvocation(request, servletContext);
    //整个框架最最核心的方法,下面分析
                du.serviceAction(request, response, servletContext, mapping);

            } finally {
                afterActionInvocation(request, servletContext, o);
                ActionContext.setContext(null);
            }
        }

    du.serviceAction(request, response, servletContext, mapping);
    //这个方法询问ActionMapper是否需要调用某个Action来处理这个(request)请求,如果ActionMapper决定需要调用某个Action,FilterDispatcher把请求的处理交给ActionProxy

    public void serviceAction(HttpServletRequest request, HttpServletResponse response, String namespace, String actionName, Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap) { 
            HashMap extraContext = createContextMap(requestMap, parameterMap, sessionMap, applicationMap, request, response, getServletConfig());  //实例化Map请求 ,询问ActionMapper是否需要调用某个Action来处理这个(request)请求
            extraContext.put(SERVLET_DISPATCHER, this); 
            OgnlValueStack stack = (OgnlValueStack) request.getAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY); 
            if (stack != null) { 
                extraContext.put(ActionContext.VALUE_STACK,new OgnlValueStack(stack)); 
            } 
            try { 
                ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(namespace, actionName, extraContext); 
    //这里actionName是通过两道getActionName解析出来的, FilterDispatcher把请求的处理交给ActionProxy,下面是ServletDispatcher的 TODO: 
                request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, proxy.getInvocation().getStack()); 
                proxy.execute(); 
             //通过代理模式执行ActionProxy
                if (stack != null){ 
                    request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY,stack); 
                } 
            } catch (ConfigurationException e) { 
                log.error("Could not find action", e); 
                sendError(request, response, HttpServletResponse.SC_NOT_FOUND, e); 
            } catch (Exception e) { 
                log.error("Could not execute action", e); 
                sendError(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e); 
            } 


    4.     FilterDispatcher询问ActionMapper是否需要调用某个Action来处理这个(request)请求,如果ActionMapper决定需要调用某个Action,FilterDispatcher把请求的处理交给ActionProxy。

    5.     ActionProxy通过Configuration Manager(struts.xml)询问框架的配置文件,找到需要调用的Action类.

         如上文的struts.xml配置

    <?xml version="1.0" encoding="GBK"?>
     <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
     <struts>
         <include file="struts-default.xml"/>
         <package name="struts2" extends="struts-default">
             <action name="add" 
                 class="edisundong.AddAction" >
                 <result>add.jsp</result>
             </action>    
         </package>
     </struts>

       如果提交请求的是add.action,那么找到的Action类就是edisundong.AddAction。

    6.     ActionProxy创建一个ActionInvocation的实例,同时ActionInvocation通过代理模式调用Action。但在调用之前ActionInvocation会根据配置加载Action相关的所有Interceptor。(Interceptor是struts2另一个核心级的概念)

    下面我们来看看ActionInvocation是如何工作的:
    ActionInvocation 是Xworks 中Action 调度的核心。而对Interceptor 的调度,也正是由ActionInvocation负责。
    ActionInvocation 是一个接口, 而DefaultActionInvocation 则是Webwork 对ActionInvocation的默认实现。
    Interceptor 的调度流程大致如下:
    1. ActionInvocation初始化时,根据配置,加载Action相关的所有Interceptor。
    2. 通过ActionInvocation.invoke方法调用Action实现时,执行Interceptor。
    Interceptor 将很多功能从我们的Action中独立出来,大量减少了我们Action的代码,独立出来的行为具有很好的重用性。XWork、WebWork的许多功能 都是有Interceptor实现,可以在配置文件中组装Action用到的Interceptor,它会按照你指定的顺序,在Action执行前后运 行。
    那么什么是拦截器。
    拦截器就是AOP(Aspect-Oriented Programming)的一种实现。(AOP是指用于在某个方法或字段被访问之前,进行拦截然后在之前或之后加入某些操作。)
    拦截器的例子这里就不展开了。
    struts-default.xml文件摘取的内容:
    < interceptor name ="alias" class ="com.opensymphony.xwork2.interceptor.AliasInterceptor" /> 
    < interceptor name ="autowiring" class ="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor" /> 
    < interceptor name ="chain" class ="com.opensymphony.xwork2.interceptor.ChainingInterceptor" /> 
    < interceptor name ="conversionError" class ="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor" /> 
    < interceptor name ="createSession" class ="org.apache.struts2.interceptor.CreateSessionInterceptor" /> 
    < interceptor name ="debugging" class ="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" /> 
    < interceptor name ="external-ref" class ="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor" /> 
    < interceptor name ="execAndWait" class ="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor" /> 
    < interceptor name ="exception" class ="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor" /> 
    < interceptor name ="fileUpload" class ="org.apache.struts2.interceptor.FileUploadInterceptor" /> 
    < interceptor name ="i18n" class ="com.opensymphony.xwork2.interceptor.I18nInterceptor" /> 
    < interceptor name ="logger" class ="com.opensymphony.xwork2.interceptor.LoggingInterceptor" /> 
    < interceptor name ="model-driven" class ="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor" /> 
    < interceptor name ="scoped-model-driven" class ="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor" /> 
    < interceptor name ="params" class ="com.opensymphony.xwork2.interceptor.ParametersInterceptor" /> 
    < interceptor name ="prepare" class ="com.opensymphony.xwork2.interceptor.PrepareInterceptor" /> 
    < interceptor name ="static-params" class ="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor" /> 
    < interceptor name ="scope" class ="org.apache.struts2.interceptor.ScopeInterceptor" /> 
    < interceptor name ="servlet-config" class ="org.apache.struts2.interceptor.ServletConfigInterceptor" /> 
    < interceptor name ="sessionAutowiring" class ="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor" /> 
    < interceptor name ="timer" class ="com.opensymphony.xwork2.interceptor.TimerInterceptor" /> 
    < interceptor name ="token" class ="org.apache.struts2.interceptor.TokenInterceptor" /> 
    < interceptor name ="token-session" class ="org.apache.struts2.interceptor.TokenSessionStoreInterceptor" /> 
    < interceptor name ="validation" class ="com.opensymphony.xwork2.validator.ValidationInterceptor" /> 
    < interceptor name ="workflow" class ="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor" /> 
    < interceptor name ="store" class ="org.apache.struts2.interceptor.MessageStoreInterceptor" /> 
    < interceptor name ="checkbox" class ="org.apache.struts2.interceptor.CheckboxInterceptor" /> 
    < interceptor name ="profiling" class ="org.apache.struts2.interceptor.ProfilingActivationInterceptor" /> 

    7.     一旦Action执行完毕,ActionInvocation负责根据struts.xml中的配置找到对应的返回结果。如上文中将结构返回“add.jsp”,但大部分时候都是返回另外一个action,那么流程又得走一遍………

     

     

    Struts2 常用的常量配置

     
    复制代码

    在struts2-core-2.1.8.1.jar的org.apache.struts2包下面的default.properties资源文件里可以查到常用的常量配置,这些不用刻意的记住:忘记的时候可以查询。总结长用的的常量配置如下面:
    复制代码
     <!-- 设置url请求后缀 -->
        <constant name="struts.action.extension" value="do,action,html,htm"></constant>
        <!-- 指定Web应用的默认编码集,相当于调用HttpServletRequest的setCharacterEncoding方法 -->
        <constant name="struts.i18n.encoding" value="UTF-8" />
        <!-- 设置浏览器是否缓存静态内容,默认值为true(生产环境下使用),开发阶段最好关闭 -->
        <constant name="struts.serve.static.browserCache" value="false" />
        <!-- 当struts的配置文件修改后,系统是否自动重新加载该文件,默认值为false(生产环境下使用),开发阶段最好打开 -->
        <constant name="struts.configuration.xml.reload" value="true" />
        <!-- 开发模式下使用,这样可以打印出更详细的错误信息 -->
        <constant name="struts.devMode" value="true" />  
    复制代码
    复制代码
    <!-- 默认的视图主题 -->  
    <constant name="struts.ui.theme" value="simple" />  
    <!-- spring 托管 -->  
    <constant name="struts.objectFactory" value="spring" />  


      
        <!--   
            指定加载struts2配置文件管理器,默认为org.apache.struts2.config.DefaultConfiguration   
            开发者可以自定义配置文件管理器,该类要实现Configuration接口,可以自动加载struts2配置文件。   
        -->  
        <constant name="struts.configuration"  
            value="org.apache.struts2.config.DefaultConfiguration" />  
      
        <!-- 设置默认的locale和字符编码 -->  
           <constant name="struts.locale" value="zh_CN" />  
           <constant name="struts.i18n.encoding" value="GBK" />  
      
        <!-- 指定Struts的工厂类 -->  
        <constant name="struts.objectFactory" value="spring"></constant>  
      
        <!--   
            指定spring框架的装配模式,装配方式有: name, type, auto, and constructor (name   
            是默认装配模式)   
        -->  
        <constant name="struts.objectFactory.spring.autoWire" value="name" />  
      
        <!-- 该属性指定整合spring时,是否对bean进行缓存,值为true or false,默认为true -->  
        <cosntant name="struts.objectFactory.spring.useClassCache" />  
     
        <!-- 指定类型检查,包含tiger和notiger -->  
        <cosntant name="struts.objectTypeDeterminer" value="tiger" />  
     
        <!-- 该属性指定处理 MIME-type multipart/form-data,文件上传 --> 
         <constant name="struts.multipart.parser" value="cos" />  
         <constant name="struts.multipart.parser" value="pell" />  
         <constant name="struts.multipart.parser" value="jakarta" />  
     
        <!-- 指定上传文件时的临时目录,默认使用 javax.servlet.context.tempdir -->  
        <constant name="struts.multipart.saveDir" value="/tmpuploadfiles" />  
      
        <!-- 该属性指定Struts 2文件上传中整个请求内容允许的最大字节数 -->  
       <constant name="struts.multipart.maxSize" value="2097152" />  
      
        <!--   
            该属性指定Struts2应用加载用户自定义的属性文件,该自定义属性文件指定的属性不会覆盖   
            struts.properties文件中指定的属性。如果需要加载多个自定义属性文件,多个自定义属性文   
            件的文件名以英文逗号(,)隔开。(也就是说不要改写struts.properties!)   
        -->  
        <constant name="struts.custom.properties"  
            value="application,org/apache/struts2/extension/custom" />  
               
        <!-- 指定请求url与action映射器,默认为org.apache.struts2.dispatcher.mapper.DefaultActionMapper -->  
        <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />  
     

           
     
        <!-- 设置是否支持动态方法调用,true为支持,false不支持. -->  
        <constant name="struts.enable.DynamicMethodInvocation" value="true" />  
               
        <!-- 设置是否可以在action中使用斜线,默认为false不可以,想使用需设置为true. -->  
        <constant name="struts.enable.SlashesInActionNames" value="true" />  
           
        <!-- 是否允许使用表达式语法,默认为true. -->  
        <constant name="struts.tag.altSyntax" value="true" />  

      
        <!-- 设置是否每次请求,都重新加载资源文件,默认值为false. -->  
        <cosntant name="struts.i18n.reload" value="false" />  
      
        <!-- 标准的UI主题,默认的UI主题为xhtml,可以为simple,xhtml或ajax -->  
        <cosntant name="struts.ui.theme" value="xhtml" />  
               
        <!-- 模板目录 -->  
        <cosntant name="struts.ui.templateDir" value="template" /> 
     
        <!-- 设置模板类型. 可以为 ftl, vm, or jsp -->  
        <cosntant name="struts.ui.templateSuffix" value="ftl" />  
      
        <!-- 定位velocity.properties 文件. 默认velocity.properties -->  
        <cosntant name="struts.velocity.configfile" value="velocity.properties" />  
           
        <!-- 设置velocity的context. -->  
       <cosntant name="struts.velocity.contexts" value="...." />  
           
        <!-- 定位toolbox -->  
        <cosntant name="struts.velocity.toolboxlocation" value="...." />  

        <!-- 指定web应用的端口 -->  
        <cosntant name="struts.url.http.port" value="80" />  
           
        <!-- 指定加密端口 -->          
       <cosntant name="struts.url.https.port" value="443" />  
      
         <!-- 设置生成url时,是否包含参数.值可以为: none,get or all -->  
        <cosntant name="struts.url.includeParams" value="get" />  
      
        <!-- 设置要加载的国际化资源文件,以逗号分隔. -->  
          <cosntant name="struts.custom.i18n.resources" value="application" />  
            
        <!-- 对于一些web应用服务器不能处理HttpServletRequest.getParameterMap(),   
            像 WebLogic,Orion, and OC4J等,须设置成true,默认为false. -->  
        <cosntant name="struts.dispatcher.parametersWorkaround" value="false" />     
      
        <!-- 指定freemarker管理器 -->  
        <cosntant name="struts.freemarker.manager.classname" value="org.apache.struts2.views.freemarker.FreemarkerManager" />    

      <!-- 设置是否对freemarker的模板设置缓存,效果相当于把template拷贝到 WEB_APP/templates. -->  
         <cosntant name="struts.freemarker.templatesCache" value="false" />       


      <!-- 通常不需要修改此属性. -->  
      <cosntant name="struts.freemarker.wrapper.altMap" value="true" />    


      <!-- 指定xslt result是否使用样式表缓存.开发阶段设为true,发布阶段设为false. -->  
      <cosntant name="struts.xslt.nocache" value="false" />    


      <!-- 设置struts自动加载的文件列表. -->  
      <cosntant name="struts.configuration.files" value="struts-default.xml,struts-plugin.xml,struts.xml" />  


      <!-- 设定是否一直在最后一个slash之前的任何位置选定namespace. -->  
      <cosntant name="struts.mapper.alwaysSelectFullNamespace" value="false" />  

    
    
    复制代码
    复制代码
    <!-- 默认的视图主题 -->  
    <constant name="struts.ui.theme" value="simple" />  
    <!-- spring 托管 -->  
    <constant name="struts.objectFactory" value="spring" />  


      


        <!--   
            指定加载struts2配置文件管理器,默认为org.apache.struts2.config.DefaultConfiguration   
            开发者可以自定义配置文件管理器,该类要实现Configuration接口,可以自动加载struts2配置文件。   
        -->  
        <constant name="struts.configuration"  
            value="org.apache.struts2.config.DefaultConfiguration" />  
      
        <!-- 设置默认的locale和字符编码 -->  
           <constant name="struts.locale" value="zh_CN" />  
           <constant name="struts.i18n.encoding" value="GBK" />  
      
        <!-- 指定Struts的工厂类 -->  
        <constant name="struts.objectFactory" value="spring"></constant>  
      
        <!--   
            指定spring框架的装配模式,装配方式有: name, type, auto, and constructor (name   
            是默认装配模式)   
        -->  
        <constant name="struts.objectFactory.spring.autoWire" value="name" />  
      
        <!-- 该属性指定整合spring时,是否对bean进行缓存,值为true or false,默认为true -->  
        <cosntant name="struts.objectFactory.spring.useClassCache" />  
     
        <!-- 指定类型检查,包含tiger和notiger -->  
        <cosntant name="struts.objectTypeDeterminer" value="tiger" />  
     
        <!-- 该属性指定处理 MIME-type multipart/form-data,文件上传 --> 
         <constant name="struts.multipart.parser" value="cos" />  
         <constant name="struts.multipart.parser" value="pell" />  
         <constant name="struts.multipart.parser" value="jakarta" />  
     
        <!-- 指定上传文件时的临时目录,默认使用 javax.servlet.context.tempdir -->  
        <constant name="struts.multipart.saveDir" value="/tmpuploadfiles" />  
      
        <!-- 该属性指定Struts 2文件上传中整个请求内容允许的最大字节数 -->  
       <constant name="struts.multipart.maxSize" value="2097152" />  
      
        <!--   
            该属性指定Struts2应用加载用户自定义的属性文件,该自定义属性文件指定的属性不会覆盖   
            struts.properties文件中指定的属性。如果需要加载多个自定义属性文件,多个自定义属性文   
            件的文件名以英文逗号(,)隔开。(也就是说不要改写struts.properties!)   
        -->  
        <constant name="struts.custom.properties"  
            value="application,org/apache/struts2/extension/custom" />  
               
        <!-- 指定请求url与action映射器,默认为org.apache.struts2.dispatcher.mapper.DefaultActionMapper -->  
        <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />  
     

           
     
        <!-- 设置是否支持动态方法调用,true为支持,false不支持. -->  
        <constant name="struts.enable.DynamicMethodInvocation" value="true" />  
               
        <!-- 设置是否可以在action中使用斜线,默认为false不可以,想使用需设置为true. -->  
        <constant name="struts.enable.SlashesInActionNames" value="true" />  
           
        <!-- 是否允许使用表达式语法,默认为true. -->  
        <constant name="struts.tag.altSyntax" value="true" />  

      
        <!-- 设置是否每次请求,都重新加载资源文件,默认值为false. -->  
        <cosntant name="struts.i18n.reload" value="false" />  
      
        <!-- 标准的UI主题,默认的UI主题为xhtml,可以为simple,xhtml或ajax -->  
        <cosntant name="struts.ui.theme" value="xhtml" />  
               
        <!-- 模板目录 -->  
        <cosntant name="struts.ui.templateDir" value="template" /> 
     
        <!-- 设置模板类型. 可以为 ftl, vm, or jsp -->  
        <cosntant name="struts.ui.templateSuffix" value="ftl" />  
      
        <!-- 定位velocity.properties 文件. 默认velocity.properties -->  
        <cosntant name="struts.velocity.configfile" value="velocity.properties" />  
           
        <!-- 设置velocity的context. -->  
       <cosntant name="struts.velocity.contexts" value="...." />  
           
        <!-- 定位toolbox -->  
        <cosntant name="struts.velocity.toolboxlocation" value="...." />  

        <!-- 指定web应用的端口 -->  
        <cosntant name="struts.url.http.port" value="80" />  
           
        <!-- 指定加密端口 -->          
       <cosntant name="struts.url.https.port" value="443" />  
      
         <!-- 设置生成url时,是否包含参数.值可以为: none,get or all -->  
        <cosntant name="struts.url.includeParams" value="get" />  
      
        <!-- 设置要加载的国际化资源文件,以逗号分隔. -->  
          <cosntant name="struts.custom.i18n.resources" value="application" />  
            
        <!-- 对于一些web应用服务器不能处理HttpServletRequest.getParameterMap(),   
            像 WebLogic,Orion, and OC4J等,须设置成true,默认为false. -->  
        <cosntant name="struts.dispatcher.parametersWorkaround" value="false" />     
      
        <!-- 指定freemarker管理器 -->  
        <cosntant name="struts.freemarker.manager.classname" value="org.apache.struts2.views.freemarker.FreemarkerManager" />    

      <!-- 设置是否对freemarker的模板设置缓存,效果相当于把template拷贝到 WEB_APP/templates. -->  
         <cosntant name="struts.freemarker.templatesCache" value="false" />       


      <!-- 通常不需要修改此属性. -->  
      <cosntant name="struts.freemarker.wrapper.altMap" value="true" />    


      <!-- 指定xslt result是否使用样式表缓存.开发阶段设为true,发布阶段设为false. -->  
      <cosntant name="struts.xslt.nocache" value="false" />    


      <!-- 设置struts自动加载的文件列表. -->  
      <cosntant name="struts.configuration.files" value="struts-default.xml,struts-plugin.xml,struts.xml" />  


      <!-- 设定是否一直在最后一个slash之前的任何位置选定namespace. -->  
      <cosntant name="struts.mapper.alwaysSelectFullNamespace" value="false" />  

  • 相关阅读:
    【Vue】 修饰符sync
    【VUE】vue路由跳转的方式
    【Element】elementui的Cascader 级联选择器,在懒加载的时候数据无法回显的解决方案
    【ES6】利用ES6 Set 将数组去重
    【.NETCORE】Refit 框架
    【.NETCORE】ASP.NET Core SignalR
    【Visual Studio Code】驼峰翻译助手
    VueX(Vue状态管理模式)
    hdmi 随笔
    ad 差分布线 等长布线
  • 原文地址:https://www.cnblogs.com/hanease/p/15727738.html
Copyright © 2011-2022 走看看