[昨日技术]struts1.x中ActionServlet的config/${module}配置说明

从零到一:基于STM8的125KHz RFID读卡器实现与曼彻斯特码解析实战 本文详细介绍了基于STM8单片机的125KHz RFID读卡器实现过程,重点解析了曼彻斯特码的编码原理与解码算法。通过硬件电路设计、软件实现及性能优化,帮助开发者低成本构建稳定读取EM4100卡片的系统,适用于门禁、考勤等应用场景。 阅读详情

在一篇12年前的api说明中看到了关于本文要描述的主题的原版说明(http://www.d.umn.edu/~tcolburn/cs4531/struts/api/org/apache/struts/action/ActionServlet.html),深深的汗一把……

起因是某个运转了很多年的节点系统,使用struts1.x开发的。由于了解struts是从2开始的,知道1跟2有大的差异,那时2都有点末日红花,所以尽管当初看到这个节点系统时,对其配置的实现有些疑惑,然而并没有更进一小步的看一下ActionServlet类的实现,最近又翻开了此系统,由于一直打算写一个昨日系列的技术文,因此就拿此事作为第一篇了。

原版的配置说明:

The standard version of ActionServlet is configured based on the following servlet initialization parameters, which you will specify in the web application deployment descriptor (/WEB-INF/web.xml) for your application. Subclasses that specialize this servlet are free to define additional initialization parameters.

 

config - Comma-separated list of context-relative path(s) to the XML resource(s) containing the configuration information for the default module. (Multiple files support since Struts 1.1) [/WEB-INF/struts-config.xml].

config/${module} - Comma-separated list of Context-relative path(s) to the XML resource(s) containing the configuration information for the module that will use the specified prefix (/${module}). This can be repeated as many times as required for multiple modules. (Since Struts 1.1)

configFactory - The Java class name of the ModuleConfigFactory used to create the implementation of the ModuleConfig interface. [org.apache.struts.config.impl.DefaultModuleConfigFactory]

convertNull - Force simulation of the Struts 1.0 behavior when populating forms. If set to true, the numeric Java wrapper class types (like java.lang.Integer) will default to null (rather than 0). (Since Struts 1.1) [false]

rulesets - Comma-delimited list of fully qualified classnames of additional org.apache.commons.digester.RuleSet instances that should be added to the Digester that will be processing struts-config.xml files. By default, only the RuleSet for the standard configuration elements is loaded. (Since Struts 1.1)

validating - Should we use a validating XML parser to process the configuration file (strongly recommended)? [true]

 

关键部分的大概翻译:

标准版的ActionServlet是基于下面的servlet初始化参数进行配置的(在/WEB-INF/web.xml内指定)。特例化的ActionServlet子类可以自由定义附加的初始化参数。

config –以逗号分隔开的xml资源文件列表(路径代表相对于当前上下文),包含默认模块的配置信息(struts1.1之后支持多个配置文件)[默认:/WEB-INF/struts-config.xml]

config/${module} -以逗号分隔开的xml资源文件列表(路径代表相对于当前上下文),xml的配置信息是针块指定前缀的模块的(模块的前缀是由/${module}指定的)。(struts1.1.起可用)

configFactory – 创建实现了ModuleConfig接口的类对象的ModuleConfigFactory工厂类

convertNull – 填充表单时强制模拟struts1.0的行为。若设为true包装器类型 (如java.lang.Integer)的默认值为null(而不是0)。(自 Struts 1.1)[默认:false]

 

 

由以上,可以看出除标准的资源配置外,你也可以使用config/${module}进行指定前缀的配置。在ActionServlet.init方法内,也可以看到对以config/开头的配置进行了初始化。
在国产麒麟V10(arm64)上离线部署Docker 24.0.6和Compose 2.30.1,保姆级避坑实录 本文详细介绍了在国产麒麟V10(arm64)操作系统上离线部署Docker 24.0.6和Compose 2.30.1的完整流程,包括环境准备、架构认知、安装步骤、系统服务优化及生产环境加固。特别针对ARM64架构的兼容性问题提供了解决方案,帮助用户在信创环境中高效部署容器化技术。 阅读详情

相关推荐

ORB-SLAM3在windows11下的编译使用

近期在学习SLAM,想部署一下ORB-SLAM3,但是自己电脑是win11系统,因此就想着在win11上部署一下。但是网上看了一些教程,有一些博客,但是可能不适合我这种情况把,就很纠结。先说下结果,配置成功,过程极其痛苦。

weixin_44457768的博客 6096

struts1.X使用通配符映射

自struts1.2.0,才可以用通配符映射         在不使用通配符的常规做法中,我们要配置很多个ActionMapping,例子.:   type="org.apache.struts.webapp.example.EditSubscriptionAction"   name="subscriptionForm"   scope="request"   validate="

IT屌丝 1007

Open3D 从体素网格构建八叉树【2025最新版】

从体素网格构建八叉树,博客长期更新,本文最近更新时间为:2025年1月1日。

点云侠的博客 34万+

Struts错误– NoSuchMethodError:Digester.parse(Ljava / net / URL;)Ljava / lang / Object

问题 在Struts初始化期间,它会遇到以下错误消息。 SEVERE: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to ...

一名可爱的技术搬运工 484

《嵌入式最全面试题-Offer直通车》目录

嵌入式领域蓬勃发展,嵌入式工程师成为众多科技企业争抢的热门人才。如果你渴望在嵌入式面试中脱颖而出,成功斩获心仪的 offer,那么《嵌入式最全面试题 - Offer直通车》将是你的绝佳选择。本专栏是优快云是热门专栏,100多篇文章,总字数过百万。每月新增订阅用户过百,现在是优惠价9.9元,后面要逐渐恢复原价,早订阅早受益。本专栏精心整理了众多超万字的精华内容,总计达数十万字的嵌入式面试题总结。涵盖从嵌入式基础知识到各大厂面试真题,从驱动开发到操作系统,从硬件到软件等各个方面。

大模型大数据攻城狮的专栏 8401

YOLO11改进:轻量级改进 | 通用倒瓶颈(UIB)搜索块结合C3k2二次创新 | 轻量化之王MobileNetV4

通用倒瓶颈(UIB)搜索块替代YOLO11的C3k2

会AI的学姐 293

Struts1.2.x项目数据源配置在tomcat启动时出错解决方法

第一次在Struts1.2.x中使用数据源,谁知在Tomcat6启动时发生了错误,百度一搜,发现有许多网友也有这样的疑问,好不容易找到一位网友给的解决方法! 先把问题描述清楚: 1. Tomcat启动,当识别Struts1.2.x并使用了数据源的项目时,会有以下错误: 严重:Initializing ap...

weixin_34138521的博客 258

【BlueZ】编译产物详解:可执行文件/库文件/工具的生成路径与用途

BlueZ二次开发编译产物机制解析 摘要:在BlueZ蓝牙协议栈二次开发中,90%的报错源于对编译产物类型和路径的混淆。本文系统剖析BlueZ的三阶段编译机制:1)配置阶段生成Makefile;2)编译阶段在.libs目录下产生临时库和可执行文件(不可直接运行);3)安装阶段将产物部署到系统标准路径。重点解析守护进程、命令行工具、动态库的核心路径差异,并针对五大高频问题(如临时库运行崩溃、动态库不匹配、系统覆盖等)给出解决方案。

byte轻骑兵的技术小窝 1万+

在struts2中应用ServletConfig对象

这是一个在实际项目中遇到的问题,问题描述如下: 系统整体架构是通过struts2+公司自己的框架,公司自己的框架做了很多事情,为了共用这些部分,减少开发工作量,现在要在每一个请求到达struts2的action时,在action里得到一个已经初始化的ServletConfig对象,也就是请求到达的时候,ServletConfig已经初始化了,即这个struts的Action有了两重职责,一方面要...

jsx112的专栏 184

数据分析案例-电影数据可视化分析

数据介绍数据为2011-2021电影数据可视化分析首先导入本次项目需要的包和数据 数据预处理 可视化

m0_64336780的博客 2万+

PCIe 互联的芯片-- P2P(Peer-to-Peer)

PCIe设备间支持P2P直连通信,但需满足硬件、固件和软件三方面条件。硬件需CPU/芯片组和PCIe交换器支持P2P,BIOS需开启相关设置,操作系统和驱动也要适配。消费级GPU通常禁用此功能,且PCIe P2P性能(128GB/s带宽)远低于NVLink(900GB/s)。常见限制包括ACS阻断、IOMMU隔离和带宽瓶颈。可通过nvidia-smi或NCCL测试验证P2P是否生效。该技术适合异构设备通信,但需注意配置调优。

MHD0815的博客 683

Struts源码学习 — 初始化ModuleConfig

Struts版本——1.2.9 Digester版本——1.6     初始化ModuleConfig就是指Struts将struts-config.xml初始化为ModuleConfig对象,实现这个动作的代码在ActionServlet的init()方法中,如下: initModuleConfigFactory(); // Initialize ...

gemini18的专栏 960

unity6000.0.3版本URP下ScriptableRendererFeature如何实现一张自定义贴图效果?

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值。

**My Coding Family** 585

深入浅出学习Struts框架(八):分析Struts框架实例3

上篇博客介绍了在ActionServlet的init方法实例化的时候完成的三个方法,主要是介绍了initInternal()方法、initOther()方法、initServlet()方法这三个方法。 通过上篇博客的介绍我门知道initInternal()方法主要是创建资源类MessageResources的,比如说国际化资源等,具体这里可以见org.apache.stru...

weixin_30578677的博客 193

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

struts1 module

在一个比较大的系统开发过程中,对于struts-config文件,我们希望能按模块分成多个配置,这样不同开发人员可以只关注自己的struts configuration文件,在调试时可以不加载其他模块的配置文件,更容易维护。 方法: (1)按模块配置多个config文件,每个都是合法的struts configuration文件。如:struts-main.xml,struts-module1...

hippoppower的专栏 222

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Struts源码学习 — ActionServlet的初始化

Struts版本:1.2.9 ActionServlet的初始化由org.apache.struts.action.ActionServlet类的init()方法实现,代码如下: /**    * Initialize this servlet.  Most of the processing has been factored into    * support methods so th...

gemini18的专栏 267

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

ActionServlet的参数的配置

<contrller nocache="true" null="true" processorClass="com.myCompany.struts.RequestProcessor" /> Struts配置  Struts配置文件 (struts-config.xml)用来装入多个关键的框架组件。这些对象一起构成了Struts  配置。   下面配置针对常规ActionForm和D

Java教程 574

扩展Struts的ActionServlet满足特殊初始化需求

我们知道,对一个Web Application来说,在Web服务器启动时,服务器会调用Web应用中的Serlvet的init()函数进行初始化。每个Serlvet基本信息和初始化信息都在/WEB-INF/web.xml中进行配置。如果Web应用采用了Struts框架,那么它配有一个基本的Serlvet叫action,它具有一个初始化文件:/WEB-INF/struts-config.xml。利用这

1006

层层递进Struts1(四)之预加载ActionServlet

Struts的执行相当于分为两个阶段,预加载阶段和执行阶段,预加载阶段是指在Tomcat启动之时就开始执行的内容,而此时我们并未真正进入跳转逻辑,这篇博客我们来分析一下预加载阶段。     还记得这个web.xml是如何配置的吗? <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="htt

李达 2994

没有网络连接时 启动 tomcat 异常

在没有连接网络的环境下,启动Tomcat提示如下错误: -Can't create Tiles definition factory for module ''.Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as un...

linkon 730

Struts功能详解 ——ActionServlet

ActionServlet类是Struts框架的内置核心控制器组件,它继承了javax.servlet.http.HttpServlet类。Struts的启动通常从 加载ActionServlet开始。Web容器会在首次启动或Struts应用的第一个请求到达时加载ActionServlet。一般情况下都 配置web容器比如tomcat启动的时候加载ActionServlet类,使用&lt;load...

web开发自学 245

struts1 Action原理与配置

今天临时调到另外一个项目帮忙,三天时间修改一个功能,e(⊙o⊙)…,刚down下项目一看是struts1+Hibernate3,平时一直采用spring+springMvc+springData+Hibernate,之前只接触过struts2还好久没用了,只好先来看一下struts1的action配置了,又因为时间有限有限只好摘抄他人文章了,哈哈  首先介绍下struts1工作原理:

cnsu-cmh 3844

ActionServlet详解

ActionServlet

QS111111111的博客 1624
上一篇: 如何在spring中等价配置得到原本由jndi配置实现的数据源?
下一篇: [昨日实践]CentOS手工安装mysql5.7
smartcore
博客等级 码龄19年 30粉丝 47原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值