struts2架构中核心对象的探索—— Dispatcher&ConfigurationProvider

【Qt串口调试助手】1.1 - Qt5编写串口调试助手,Qt串口编程 这章来学习串口数据流操作。仿照成品制作一个自己用Qt编写的串口助手。 1. 布局UI界面 创建QWidget工程,布局UI界面:拖入2个 Plain Text Edit,作为串口数据的接收显示和发送框。 拖入几个 Combo Box 、Label 和 Push Button,使用两个Widget进行布局。如下所示。 将接收区的 Plain Text Edit,属性勾选上 readOnly,使其运行时不会被人为的输入操作影响。 加入一些弹簧,使布局美观。(有必要可以加设置不能调整.. 阅读详情

首先强调一下struts2的线程程安全,在Struts2中大量采用ThreadLocal线程局部变量的方法来保证线程的安全,像Dispatcher等都是通过ThreadLocal来保存变量值,使得每个线程都有自己独立的实例变量,互不相干。
接下来就从Dispatcher开始看起,先看其构造函数:

    //创建Dispatcher,此类是一个Delegate,它是真正完成根据url解析转向,读取对应Action的地方  
    public Dispatcher(ServletContext servletContext, Map<String, String> initParams) {  
        this.servletContext = servletContext;  
        //配置在web.xml中的param参数  
        this.initParams = initParams;  
    }  

我们再看在FilterDispatcher创建Dispatcher的:

protected Dispatcher createDispatcher(FilterConfig filterConfig) {  
    Map<String, String> params = new HashMap<String, String>();  
    for (Enumeration e = filterConfig.getInitParameterNames(); e.hasMoreElements();) {  
        String name = (String) e.nextElement();  
        String value = filterConfig.getInitParameter(name);  
        params.put(name, value);  
    }  
    //都可以从FilterConfig中得到  
    return new Dispatcher(filterConfig.getServletContext(), params);  
}  

创建Dispatcher之后,来看init()方法,init()方法是用来Load用户配置文件,资源文件以及默认的配置文件,主要分七步走,看下面注释:

  public void init() {  

    if (configurationManager == null) {  
    //设置ConfigurationManager的defaultFrameworkBeanName.  
    //这里DEFAULT_BEAN_NAME为struts,这是xwork框架的内容,Framework可以是xwork,struts,webwork等  
        configurationManager = new ConfigurationManager(BeanSelectionProvider.DEFAULT_BEAN_NAME);  
    }  
    //读取properties信息,默认的default.properties,  
    init_DefaultProperties(); // [1]  
    //读取xml配置文件  
    init_TraditionalXmlConfigurations(); // [2]  
    //读取用户自定义的struts.properties  
    init_LegacyStrutsProperties(); // [3]  
    //自定义的configProviders  
    init_CustomConfigurationProviders(); // [5]  
    //载入FilterDispatcher传进来的initParams  
    init_FilterInitParameters() ; // [6]  
    //将配置文件中的bean与具体的类映射  
    init_AliasStandardObjects() ; // [7]  

    //构建一个用于依赖注射的Container对象  
    //在这里面会循环调用上面七个ConfigurationProvider的register方法  
    //其中的重点就是DefaultConfiguration的#reload()方法  
      Container container = init_PreloadConfiguration();  
      container.inject(this);  
      init_CheckConfigurationReloading(container);  
      init_CheckWebLogicWorkaround(container);  

      if (!dispatcherListeners.isEmpty()) {  
          for (DispatcherListener l : dispatcherListeners) {  
              l.dispatcherInitialized(this);  
          }  
      }  
  }  

分七步载入各种配置属性,都是通过ConfigurationProvider接口进行的,这个接口提供init(),destroy(),register()等方法.
将各种ConfigurationProvider初始化之后将实例添加到ConfigurationManager的List里面.最后通过循环调用List里的这些destroy(),register()等方法实现对配置文件的属性进行注册和销毁等功能.
下面将分析分析7步流程:

- 1:首先是init_DefaultProperties()

 private void init_DefaultProperties() {  
    configurationManager.addConfigurationProvider(new DefaultPropertiesProvider());  
}  
//接来看DefaultPropertiesProvider好了,DefaultPropertiesProvider实际上只是实现了register()方法  
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {  

    Settings defaultSettings = null;  
    try {  
        defaultSettings = new PropertiesSettings("org/apache/struts2/default");  
    } catch (Exception e) {  
        throw new ConfigurationException("Could not find or error in org/apache/struts2/default.properties", e);  
    }    
    loadSettings(props, defaultSettings);  
}
//PropertiesSettings构造方法    
    //读取org/apache/struts2/default.properties的配置信息,如果项目中需要覆盖,可以在classpath里的struts.properties里覆写  
    public PropertiesSettings(String name) {  

        URL settingsUrl = ClassLoaderUtils.getResource(name + ".properties", getClass());  

        if (settingsUrl == null) {  
            LOG.debug(name + ".properties missing");  
            settings = new LocatableProperties();  
            return;  
        }  

        settings = new LocatableProperties(new LocationImpl(null, settingsUrl.toString()));  

        // Load settings  
        InputStream in = null;  
        try {  
            in = settingsUrl.openStream();  
            settings.load(in);  
        } catch (IOException e) {  
            throw new StrutsException("Could not load " + name + ".properties:" + e, e);  
        } finally {  
            if(in != null) {  
                try {  
                    in.close();  
                } catch(IOException io) {  
                    LOG.warn("Unable to close input stream", io);  
                }  
            }  
        }  
    }  

    //loadSettings主要是将progerty的value和Locale从上面PropertiesSettings中取得并存放到LocatableProperties props  
    //这个props是register的一个入参.  
    protected void loadSettings(LocatableProperties props, final Settings settings) {  
        // We are calling the impl methods to get around the single instance of Settings that is expected  
        for (Iterator i = settings.listImpl(); i.hasNext(); ) {  
            String name = (String) i.next();  
            props.setProperty(name, settings.getImpl(name), settings.getLocationImpl(name));  
        }  
    } 

- 2:再来看第二步:init_TraditionalXmlConfigurations()

private void init_TraditionalXmlConfigurations() {  
 //首先读取web.xml中的config初始参数值     
    //如果没有配置就使用默认的DEFAULT_CONFIGURATION_PATHS:"struts-default.xml,struts-plugin.xml,struts.xml",     
    //这儿就可以看出为什么默认的配置文件必须取名为这三个名称了     
    //如果不想使用默认的名称,直接在web.xml中配置config初始参数即可   
    String configPaths = initParams.get("config");  
    if (configPaths == null) {  
        configPaths = DEFAULT_CONFIGURATION_PATHS;  
    }  
    String[] files = configPaths.split("\\s*[,]\\s*");  
    for (String file : files) {  
        if (file.endsWith(".xml")) {  
            if ("xwork.xml".equals(file)) {  
    //XmlConfigurationProvider负责解析xwork.xml  
                configurationManager.addConfigurationProvider(new XmlConfigurationProvider(file, false));  
            } else {  
    //其它xml都是由StrutsXmlConfigurationProvider来解析  
                configurationManager.addConfigurationProvider(new StrutsXmlConfigurationProvider(file, false, servletContext));  
            }  
        } else {  
            throw new IllegalArgumentException("Invalid configuration file name");  
        }  
    }  
} 
 对于其它配置文件只用StrutsXmlConfigurationProvider,此类继承XmlConfigurationProvider,而XmlConfigurationProvider又实现ConfigurationProvider接口。
 类XmlConfigurationProvider负责配置文件的读取和解析,
     首先通过init()中的loadDocuments(configFileName);
     利用DomHelper中的 public static Document parse(InputSource inputSource, Map<String, String> dtdMappings) 将configFileName配置文件通过SAX解析方式按照DtdMappings解析成Document对象.
     然后通过Provider的register()方法加载"bean"和"constant"属性,
     再通过loadPackages()加载package及package中的属性
addAction()方法负责读取<action>标签,并将数据保存在ActionConfig中;
addResultTypes()方法负责将<result-type>标签转化为ResultTypeConfig对象;
loadInterceptors()方法负责将<interceptor>标签转化为InterceptorConfi对象;
loadInterceptorStack()方法负责将<interceptor-ref>标签转化为InterceptorStackConfig对象;
loadInterceptorStacks()方法负责将<interceptor-stack>标签转化成InterceptorStackConfig对象。

而上面的方法最终会被addPackage()方法调用,addPackage又会被Provider的loadPackages()调用,将所读取到的数据汇集到PackageConfig对象中。


 protected PackageConfig addPackage(Element packageElement) throws ConfigurationException {  
     PackageConfig.Builder newPackage = buildPackageContext(packageElement);  

     if (newPackage.isNeedsRefresh()) {  
         return newPackage.build();  
     }  
     // add result types (and default result) to this package  
     addResultTypes(newPackage, packageElement);  
     // load the interceptors and interceptor stacks for this package  
     loadInterceptors(newPackage, packageElement);  
     // load the default interceptor reference for this package  
     loadDefaultInterceptorRef(newPackage, packageElement);  
     // load the default class ref for this package  
     loadDefaultClassRef(newPackage, packageElement);  
     // load the global result list for this package  
     loadGlobalResults(newPackage, packageElement);  
     // load the global exception handler list for this package  
     loadGobalExceptionMappings(newPackage, packageElement);  
     // get actions  
     NodeList actionList = packageElement.getElementsByTagName("action");  
     for (int i = 0; i < actionList.getLength(); i++) {  
         Element actionElement = (Element) actionList.item(i);  
         addAction(actionElement, newPackage);  
     }  
     // load the default action reference for this package  
     loadDefaultActionRef(newPackage, packageElement);  
     PackageConfig cfg = newPackage.build();  
     configuration.addPackageConfig(cfg.getName(), cfg);  
     return cfg;  
 }    

  loadConfigurationFiles解析读取xml中的内容  
 private List<Document> loadConfigurationFiles(String fileName, Element includeElement) {        
   ...    
//通过DomHelper调用SAX进行解析xml  
doc = DomHelper.parse(in, dtdMappings);  
...  
   Element rootElement = doc.getDocumentElement();  
   NodeList children = rootElement.getChildNodes();  
   int childSize = children.getLength();  

   for (int i = 0; i < childSize; i++) {  
     Node childNode = children.item(i);  

     if (childNode instanceof Element) {  
       Element child = (Element) childNode;  

       final String nodeName = child.getNodeName();  

       if ("include".equals(nodeName)) {  
         String includeFileName = child.getAttribute("file");  

      //解析每个action配置,对于include文件可以使用通配符*来进行配置     
         //如Struts.xml中可配置成<include file="actions_*.xml"/>    
         if (includeFileName.indexOf('*') != -1) {  
           ClassPathFinder wildcardFinder = new ClassPathFinder();  
           wildcardFinder.setPattern(includeFileName);  
           Vector<String> wildcardMatches = wildcardFinder.findMatches();  
           for (String match : wildcardMatches) {  
       //递归Load子file中的<include/>  
             docs.addAll(loadConfigurationFiles(match, child));  
           }  
         } else {  

           docs.addAll(loadConfigurationFiles(includeFileName, child));  
         }  
       }  
     }  
   }  
   docs.add(doc);  
   loadedFileUrls.add(url.toString());  
   ...  
   return docs;  
 } 

- 3:接下来第三步:

init_LegacyStrutsProperties()调用的是LegacyPropertiesConfigurationProvider
通过比较前面DefaultPropertiesProvider也调用的是LegacyPropertiesConfigurationProvider,发现DefaultPropertiesProvider继承自后者,但重写了register()方法,
主要是生成PropertiesSetting的不同,前者是根据org/apache/struts2/default.properties,后者是根据struts.properties
我们展开register()中的Settings.getInstance(),最后是调用getDefaultInstance()

private static Settings getDefaultInstance() {  
     if (defaultImpl == null) {  
         // Create bootstrap implementation  
         //不带参数的DefaultSettings(),区别与DefaultPropertiesProvider中直接带default.properties参数  
         //不带参数就是默认为struts.propertes,并且加载struts.custom.properties所定义的properties文件  
         defaultImpl = new DefaultSettings();  

         // Create default implementation  
         try {  
             //STRUTS_CONFIGURATION为:struts.configuration  
             //在struts.proterties中查找struts.configuration的值,这个值必须是org.apache.struts2.config.Configuration接口的实现类  
             //所以我有个困惑就是在下面的转换当中怎么将Configuration转换成Setting类型的...  
             //这一点先放下了,有时间再研究  
             String className = get(StrutsConstants.STRUTS_CONFIGURATION);  

             if (!className.equals(defaultImpl.getClass().getName())) {  
                 try {  
                     // singleton instances shouldn't be built accessing request or session-specific context data  
                     defaultImpl = (Settings) ObjectFactory.getObjectFactory().buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);  
                 } catch (Exception e) {  
                     LOG.error("Settings: Could not instantiate the struts.configuration object, substituting the default implementation.", e);  
                 }  
             }  
         } catch (IllegalArgumentException ex) {  
             // ignore 

去掉了第四步:init_ZeroConfiguration();
- 5:第五步是自定义的configProviders

 private void init_CustomConfigurationProviders() {  
    //从这里可以看到可以将自定义的Provider定义在web.xml中FilterDispatcher的param中:configProviders  
    String configProvs = initParams.get("configProviders");  
    if (configProvs != null) {  
        String[] classes = configProvs.split("\\s*[,]\\s*");  
        for (String cname : classes) {  
            try {  
                Class cls = ClassLoaderUtils.loadClass(cname, this.getClass());  
                ConfigurationProvider prov = (ConfigurationProvider)cls.newInstance();  
                configurationManager.addConfigurationProvider(prov);  
            }   
            ...  
        }  
    }  
} 
  • 6:第六步:init_FilterInitParameters
//从这里可以看出struts.properties中的属性不仅可以在struts.xml中以constant形式定义,而且可以在FilterDispatcher的param中定义    
    private void init_FilterInitParameters() {  
        configurationManager.addConfigurationProvider(new ConfigurationProvider() {  
            public void destroy() {}  
            public void init(Configuration configuration) throws ConfigurationException {}  
            public void loadPackages() throws ConfigurationException {}  
            public boolean needsReload() { return false; }  

            public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {  
                props.putAll(initParams);//在这里实现滴~  
            }  
        });  
    } 
  • 第七步:init_AliasStandardObjects
    使用BeanSelectionProvider这是将配置文件中定义的与实际的类相映射,就是注入bean的依赖关系,

    接下来是看怎样调用这些ConfigurationProviders,展开init_PreloadConfiguration()

   private Container init_PreloadConfiguration() {  
     Configuration config = configurationManager.getConfiguration();  
     Container container = config.getContainer();  

     boolean reloadi18n = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_I18N_RELOAD));  
     LocalizedTextUtil.setReloadBundles(reloadi18n);  

     return container;  
 }  
      //再看getConfiguration()  
 public synchronized Configuration getConfiguration() {  
     if (configuration == null) {  
         setConfiguration(new DefaultConfiguration(defaultFrameworkBeanName));  
         try {  
             //重点就是这个reloadContainer  
             configuration.reloadContainer(getContainerProviders());  
         } catch (ConfigurationException e) {  
             setConfiguration(null);  
             throw new ConfigurationException("Unable to load configuration.", e);  
         }  
     } else {  
         conditionalReload();  
     }  

     return configuration;  
 }  

展开DefaultConfiguration中的reloadContainer

  public synchronized List<PackageProvider> reloadContainer(List<ContainerProvider> providers) throws ConfigurationException {  
      packageContexts.clear();  
      loadedFileNames.clear();  
      List<PackageProvider> packageProviders = new ArrayList<PackageProvider>();  

      //Struts2(xwork2)用Container来完成依赖注入的功能  
      //首先初始化一个ContainerBuilder,再由builder来保存接口与实现类或工厂类的对应关系  
      //然后通过builder.create(boolean)方法产生container  
      //由container.getInstance(Class);就可以得到接口的实现实例了  
      //这一部分比较复杂,后面研究完成了,会单独拿出来讲,这里先弄清楚Xwork依赖注入的实现步骤就可以了  
      ContainerProperties props = new ContainerProperties();  
      ContainerBuilder builder = new ContainerBuilder();  
      for (final ContainerProvider containerProvider : providers)  
      {  
      //循环调用ConfigurationProvider的init和register方法,明白了吧,在这里统一循环调用  
          containerProvider.init(this);  
          containerProvider.register(builder, props);  
      }  
      props.setConstants(builder);  
      //注入依赖关系,在这里并不产生实例  
      builder.factory(Configuration.class, new Factory<Configuration>() {  
          public Configuration create(Context context) throws Exception {  
              return DefaultConfiguration.this;  
          }  
      });  

      ActionContext oldContext = ActionContext.getContext();  
      try {  
          // Set the bootstrap container for the purposes of factory creation  
          Container bootstrap = createBootstrapContainer();  
          setContext(bootstrap);  
          //create已经注入依赖关系的Container  
          container = builder.create(false);  
          setContext(container);  
          objectFactory = container.getInstance(ObjectFactory.class);  

          // Process the configuration providers first  
          for (final ContainerProvider containerProvider : providers)  
          {  
              if (containerProvider instanceof PackageProvider) {  
                  container.inject(containerProvider);  
            //调用PackageProvider的loadPackages()方法,这里主要是针对XmlConfigurationProvider和StrutsXmlConfigurationProvider  
                  ((PackageProvider)containerProvider).loadPackages();  
                  packageProviders.add((PackageProvider)containerProvider);  
              }  
          }  

          // Then process any package providers from the plugins  
          Set<String> packageProviderNames = container.getInstanceNames(PackageProvider.class);  
          if (packageProviderNames != null) {  
              for (String name : packageProviderNames) {  
                  PackageProvider provider = container.getInstance(PackageProvider.class, name);  
                  provider.init(this);  
                  provider.loadPackages();  
                  packageProviders.add(provider);  
              }  
          }  

          rebuildRuntimeConfiguration();  
      } finally {  
          if (oldContext == null) {  
              ActionContext.setContext(null);  
          }  
      }  
      return packageProviders;  
  } 
企业微信自建应用全流程部署指南:从HTTPS到API调试 本文提供了一份详尽的企业微信自建应用部署指南,涵盖从HTTPS域名配置、Nginx反向代理到企业微信后台应用创建与API调试的全流程。核心在于构建一个符合企业微信安全要求的“可信”服务环境,并利用JupyterLab等工具进行高效调试,帮助企业快速完成内部系统与企业微信的集成。 阅读详情

相关推荐

用SPSS做信效度分析

对问卷进行Cronbach’s Alpha信度检验。如果此值高于0.8,则说明信度高;如果此值介于0.7-0.8之间,则说明信度较好;如果此值介于0.6~0.7,则说明信度可接受;如果此值小于0.6,说明信度不佳。下面利用SPSS进行分析,点击分析–标度–可靠性分析选项,选中所要分析的问卷数据或题目。得到结果,我们要看这个有用的结果,当克隆巴赫Alpha系数(也可以看标准化后的)大于0.8时候,说明问卷信度较高。

小高~的博客 1万+

struts2_源码学习_Dispatcher(1)

续Logging System 目录 Dispatcher 第一步:创建ConfigurationManager。 第二步:往ConfigurationManager添加一个FileManagerProvider 第三步:往ConfigurationManager添加一个DefaultPropertiesProvider 第四步:往ConfigurationManager添加一个Str...

Onion的博客 568

akshare 布林通道策略

import datetime import pandas as pd import backtrader as bt import matplotlib.pyplot as plt from datetime import datetime import matplotlib import akshare as ak %matplotlib inline class Boll_strategy(bt.Strategy): #自定义参数,每次买入1800手 params=(('size'.

qq_26742269的博客 5355

Struts2初始化之Dispatcher

Dispatcher也叫做核心分发器,Dispatcher类负责整个Struts2项目的初始化工作。这是一个很庞大的类,这里会挑选一些重要的方法进行分析。 很明显这是一个应用ThreadLocal的例子,它为当前线程中的一个叫做ThreadLocalMap的线程副本,使得线程与线程之间,每一个线程可以独立的修改自己的副本,而不会影响到其他线程的变量,从而使线程安全。 Dispatcher分发器的

Joseph_Geeker的博客 684

手把手教你学Simulink——基于Simulink的隔离型DC-DC全桥变换器移相控制建模示例

本文详细介绍了基于Simulink的全桥移相变换器(PSFB)建模与控制方法。首先分析了全桥移相拓扑在大功率应用中的优势,包括ZVS实现、高频化和小型化特点。随后给出了具体设计参数和移相控制策略,采用电压外环+移相角内环的双闭环控制架构。文章重点演示了Simulink建模步骤,包括主电路搭建、移相PWM生成和PI控制器设计,并通过满载稳态、负载阶跃和轻载测试三种场景验证了系统性能。最后总结了工程实践要点,提出自适应控制等扩展方向,强调移相控制通过精准时间管理实现高效能量转换的核心价值。

MHD0815的博客 272

【AI Agent系列】【MetaGPT】9. 一句话订阅专属信息 - 订阅智能体进阶,实现一个更通用的订阅智能体(2)

订阅智能体进阶(2)。不用爬虫,直接提取网页信息。从RunSubscription分离出AddSubscriptionTask的action,并且让SubscriptionRunner单独运行。

同学小张的博客 1593

Struts|Struts返回结果类型(dispatcher,redirect,redirectAction)及全局result探究

Struts|Struts返回结果类型(dispatcher,redirect,redirectAction)及全局result探究。工作之后再也没用过了,^_^,致我们逝去的青春。

不甩锅的码农 2936

手把手教你学PCIE--系统内存管理:GART(Graphics Address Remapping Table)的典型用途详解

GART(图形地址重映射表)是GPU的核心组件,主要用于地址映射转换。其典型用途分为物理模式和虚拟模式两类:在物理模式下,GART将GPU虚拟地址映射到分散的物理内存,支持DMA连续访问非连续内存块,适用于GPU渲染纹理采样和AI推理数据搬运等场景;在虚拟模式下,GART配合IOMMU实现多级映射,将GPU虚拟地址转换为虚拟机物理地址再映射到宿主机物理地址,确保多租户隔离,应用于云服务器GPU共享和容器化AI训练等虚拟化环境。两种模式分别优化了高性能计算场景和虚拟化场景的需求。

MHD0815的博客 372

Struts2源码浅析-ConfigurationProvider

ConfigurationProvider接口 主要完成struts配置文件 加载 注册过程 ConfigurationProvider接口定义 public interface ConfigurationProvider extends ContainerProvider, PackageProvider { } ContainerProvider接口定义 /** * 容器加载 注册...

爱.NET 208

神经形态芯片:IBM TrueNorth技术详解以及应用案例

2018年的一项演示中,机器人使用TrueNorth处理了复杂的路径规划,功耗仅为传统系统的1/10。它通过模仿人脑的结构,解决了传统芯片在功耗和并行性上的痛点,并在图像识别、物联网和机器人等领域展现了强大潜力。:不同于传统芯片的时钟驱动,TrueNorth是事件驱动的。例如,工厂中的振动传感器使用TrueNorth检测设备故障的早期迹象,实现了更高效的维护策略,避免了停机时间。:在医疗领域,TrueNorth可以用于可穿戴设备,比如一个智能助听器,它能过滤噪音并增强特定声音,功耗低到可以用纽扣电池供电。

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 2499

什么是 SAP PCE?

SAP Private Cloud Edition 是一种基于云计算的部署模式,它结合了公有云的灵活性和私有云的安全性,为企业提供了量身定制的云服务。在 PCE 环境中,SAP 托管和维护客户的应用系统(如 SAP S/4HANA、SAP SuccessFactors 或 SAP BW/4HANA),同时客户拥有更高的定制化权限。专属环境:每个客户在云中拥有独立的资源,这保障了更高的安全性和性能。全面托管:SAP 提供基础架构、系统管理和更新服务,降低了客户的运维成本。灵活扩展。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 2285

com.opensymphony.xwork2.config.ConfigurationManager.addConfigurationProvider

下午 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter Struts2 java.lang.NoSuchMethodError: com.opensymphony.xwork2.config.ConfigurationManager.addConfigurationPr...

weixin_34342992的博客 349

C#上位机3D可视化:HelixToolkit.Wpf集成点云/模型(机器人臂姿态实时监控)

核心控件是3D可视化的核心,需搭配和网格辅助定位;模型加载:按关节拆分机械臂模型,通过组合平移+旋转实现姿态控制;姿态更新:将机器人关节角度转换为3D模型的旋转变换,工业场景需从控制器实时获取角度;点云渲染:通过实现点云加载,需注意坐标系转换和性能优化。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 721

Vcpkg不只是Windows的玩具:在WSL2 Ubuntu里搭建C++跨平台开发环境全记录

本文详细介绍了如何在WSL2 Ubuntu环境中使用Vcpkg搭建C++跨平台开发环境。通过Vcpkg的跨平台包管理功能,开发者可以轻松管理依赖库,实现Windows和Linux双平台的统一开发体验。文章涵盖了环境准备、依赖管理、CMake集成以及持续集成实践,帮助团队提升协作效率。

weixin_30266885的博客 473

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Struts2 Dispatcher(十六)

1.使用dispatcher做注册例子 struts.xml /showPerson.jsp /testSuccess.jsp action package com.luob.action; import com.opensymphony.xwork2.ActionSupport; public

路虽远行则将至,事虽难做则必成 419

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

struts2错误:The Struts dispatcher cannot be found.

The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, wh

Jelly 570

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

Struts2中dispatcher与redirect的区别

关于dispatcher与redirect的区别,简单解释前者为转发,后者为重定向。 首先用一张图表示一下: 下面用一张表来比较一下他们之间的区别: 这是我总结的关于他们两者之间的不同,希望和大家交流。 ...

weixin_33869377的博客 263

简述Struts2中Redirect和Dispatcher的区别

1.  Redirect 把一个 HTTP 返回码(譬如 SUCCESS)以及返回的页面位置一起重新发给 Web服务器,然后由 Web 服务器产生一个新的HTTP 请求,就会产生一个新的线程,保存在原来 Action 执行的线程中的数据,就无法访问,所以无法显示出“hello world!” ;     2.Dispatcher 则不同,它只是发出内部的资源请求,只需要一个 HTTP 请求,

yanzhongren16的博客 321

struts的Dispatch形式

在上篇文章中简单的描述了struts的应用,但是其存在一个小小的问题,就是每一个请求,都会有一个与之对应的Action。比如说查询用户,就会有一个查询用户的Action;以此类推,增加也会有一个,这样就会使得Action类越来越多,不利于维护。为此出现了另外一种形式,将每一个模块的需求(不如用户的增删改查)封装到一个Action里面,而那些需求则变成这个Action的方法。访问的时候只需要传递一个

刘杰 廊坊师范学院信息技术提高班十期 861

struts2--Dispatcher

public class Dispatcher{ //提供了一个静态的ThreadLocal变量 private static ThreadLocal instance=new ThreadLocal(); //提供一个接口方法,用于获得当前线程安全的Dispatcher实例 public static Dispatcher getInstance(){ return instance

yansuoo的博客 840

struts标签错误The Struts dispatcher cannot be found.

The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are

jCuckoo的专栏 8202

Struts 2 filterDispatcher机制

9.4  Struts 2的核心机制Struts 2的处理流程已经和Struts 1大相径庭了,但是和WebWork比较相似,这都是因为Struts 2和WebWork合并的缘故,并吸取了WebWork大部分设计思想。下面讲解Struts 2的核心流程,以及其他一些处理机制。9.4.1  FilterDispatcher处理流程在Struts 2中,最重要的一个类是org.apache

hejunPurple的专栏 3565

Struts2请求转发(dispatcher)

在strtus-default.xml文件中配置请求转发的代码如下: <result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>default="true"说明了dispatcher是作为S

ccskun的专栏 1685

struts中的DispatcherAction简介+Demo

引言       小编觉得代码就是要不断的简洁,不断的加强,便于维护,这就是我们的目标!! DispatcherAction       当我们有多个功能相似的业务,使用Action的时候,就需要建立很多个Action类,而且需要在struts-config.xml文件中配置多个标签。其中好的的重复工作不说,看着就让人觉得不舒服……       所以,我们可以使用DispatcherAct

邢玉 傻傻的坚持,总有一天会成功! 1322

Struts2中出现 Dispatcher initialization failed错误

 在尝试搭建Struts2框架的时候出现该以下问题 Dispatcher initialization failed Unable to load configuration. - bean - jar:file:/D:/Workspaces/MyEclipse%208.6/.metadata/.me_tcat/webapps/demo/WEB-INF/lib/struts2-gxp-p

技术随笔 1万+

FilterDispatcher 的作用

org.apache.struts2.dispatcher.FilterDispatcher是Struts2的主要的Filter,负责四个方面的功能:        (1)执行Actions        (2)清除ActionContext        (3)维护静态内容        (4)清除request生命周期内的XWork的interceptors    另注:该过滤器应该过滤所有的...

Caspar|地主也要积余粮 692
上一篇: struts2架构中核心对象的探索—— ActionContextClearUp
下一篇: mybatis二级缓存介绍——8
码上见高低
博客等级 码龄9年 54粉丝 75原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值