Struts2学习笔记3

 Include:

配置的action比较多的时候可以根据action的逻辑进行分包操作,就是命名多个struts.xml,在主要的struts.xml中添加include标签,将其他逻辑的xml包含进来,配置如下:

<include file="struts1.xml"></include>

Intercerptor拦截器配置(跟过滤器差不多)、后面会详细讲解,先了解下配置

可以配置intercerptor栈,支持继承,如下:

<interceptors>

<interceptor-stack name="myIcp">

<interceptor-ref name=""></interceptor-ref>

</interceptor-stack>

</interceptors>

补充Action的配置:

配置action的method属性(项目中常用配置)

Name对应前台页面传递的action名字,method对应action类中的方法名字

其中在Action类中方法的名字可以这样写:doLogin,这样的目的是防止与关键字重名,但是最好还是采用前一种方法,起名字时避免起关键字,在查找方法时也比较方便。

DMI动态方法调用:

前台:

<a href="<%=path %>/test1/test1.action!add">test1</a>

Struts.xml配置:

<action name="test1" class="com.ant.action.LoginAction">

<result name="success">/msg/loginSuc.jsp</result>

<result name="fail">/msg/loginFail.jsp</result>

</action>

在Action类中要有add方法

缺陷:多个action对应的方法返回值和返回页面要一致

有点:省写action的配置

建议使用method方式

Forward action(一般不用)是指有些程序员习惯是jsp与jsp页面之间不可以直接跳转,个人认为这没太大的意义

<action name="index">

<result>/index.jsp</result>

</action>

前台: <a herf="index.action">主页</a>

默认action

<default-action-ref name="error"></default-action-ref>

<action name="error">

<result>/error.jsp</result>

</action>

在请求不存在的时候专项error.jsp

Web.xml配置不存在页面或请求的转发Error-page的配置

<error-page>

<error-code>404</error-code>

<location>/error.jsp</location>

</error-page>

根据ie版本和配置的不同有不同的情况

在action的method配置中会遇到配置量很大的情况,这时用到通配符:

*表示所有字符(不包含”/“)

**表示所有字符(包含”/“)

\表示转义符

前台

<h1>CRUD操作</h1>

<a href="addUser.action">添加用户</a><br>

<a href="delUser.action">删除用户</a><br>

<a href="modifyUser.action">修改用户</a><br>

<a href="queryUser.action">查询用户</a><br>

配置

<!--  

<action name="addUser" class="com.ant.action.UserAction"

method="add">

<result name="success">/addUserSuc.jsp</result>

</action>

<action name="delUser" class="com.ant.action.UserAction"

method="del">

<result name="success">/delUserSuc.jsp</result>

</action>

<action name="modifyUser" class="com.ant.action.UserAction"

method="modify">

<result name="success">/modifyUserSuc.jsp</result>

</action>

<action name="queryUser" class="com.ant.action.UserAction"

method="query">

<result name="success">/queryUserSuc.jsp</result>

</action>

-->

<action name="*User" class="com.ant.action.UserAction"

method="{1}">

<result name="success">userControl/{1}UserSuc.jsp</result>

</action>

由原来的四个action变成了一个action

这种优势在针对多个表进行CURD操作时更为突出

如对Role表也进行CURD操作,只需要在struts.xml中增加一个action

<action name="*Role" class="com.ant.action.RoleAction"

method="{1}">

<result name="success">userControl/{1}RoleSuc.jsp</result>

</action>

在效率上可以优化,关键在于action名字的取法:如前台:userAdd.action

后台可以action name="user*"

甚至可以起名字的时候采用_ 如User_add.action(表名_方法名,表名一定要大写,因为在配置的时候第一个参数要作为类名)

在后台可以采用<action name="*_*" class="com.ant.action.{1}Action"

method="{2}">

<result name="success">baseControl/{1}/{0}Suc.jsp</result>

</action>

由此可见,在jsp命名的时候也要注意大小写的问题{0}表示*_*

采用这种方式一定要做好注释,在系统维护的时候可以方便的查看

在通配符的使用中要注意优先级

不包含通配符的路径,优先级最高

包含通配符的路径,优先级按照顺序来定,前面的大于后面的

Zreo configration 零配置  注解配置  配置放在action类中,struts.xml是空的

在Action类中需要配置以下内容,是类级别的

@ParentPackage(value="struts-default")

@Namespace(value="/")

//@Result(name="success",value="/login.jsp")

@Results({

@Result(name="success",value="/login.jsp"),

@Result(name="error",value="/loginError.jsp")

})

前台action=user.action注意user是小写,要与类名一致,如类名UserAction

个人认为,这种方式将是struts2配置的发展方向

<!--EndFragment-->
海康视觉平台VisionMaster实战入门:从通讯配置到工具应用 本文为海康VisionMaster视觉平台实战入门指南,详细介绍了从软件安装准备、与PLC等外部设备的通讯配置,到匹配定位、测量、畸变矫正等核心工具的应用方法。通过实战案例拆解,帮助工程师快速掌握如何搭建完整的机器视觉检测与引导定位系统,实现工业自动化项目落地。 阅读详情

相关推荐

【故障排查】telnet连接失败:端口23不可达的深度分析与解决方案

本文深度解析telnet连接失败时端口23不可达的常见原因与解决方案。从快速自查目标地址、端口到服务端排查,涵盖服务状态检查、防火墙配置及安全组设置,并提供进阶诊断工具与抓包分析方法。文章强调telnet协议的安全风险,建议在生产环境中改用SSH等加密协议进行远程管理。

weixin_28323057的博客 404

Struts2.3.1官方文档学习笔记

Struts2.3.1官方文档学习笔记

dampce32的专栏 122

MuJoCo柔性体仿真实战:从FlexComp建模到自定义模型导入

柔性体仿真是机器人交互研究中不可或缺的一环,MuJoCo作为高精度物理求解器,凭借高效的求解速度与批量并行能力,成为强化学习与软体抓取任务的热门选择。其FlexComp机制将连续材料离散为粒子-约束系统,以较低建模成本模拟布料、软组织等形变行为,相比Gazebo等平台更具实时性与可扩展性。技术价值体现在自定义柔性体建模与导入流程中:通过XML配置网格密度、间距与材料参数,即可生成贴合任务需求的软体垫子或硅胶抓手。在柔性抓取、颗粒抓手、医疗仿真等场景中,该方法能快速构建可训练的环境。围绕环境搭建、FlexCo

weixin_29045585的博客 166

struts2学习笔记3

struts2学习笔记3黑马视频的学习笔记3:ognl概述ognl是一种表达式,它的功能比el表达式更加强大, 主要学习通过它和struts2的标签一起使用,来操作值栈里的数据。ognl不是struts2的一部分,是一个单独的项目,只是经常和struts2一起使用ognl入门首先在jsp页面中引入struts2的标签库。使用标签和ognl表达式&lt;%@ page language="java"...

shanshuisheng的博客 202

基于Meteoinfo与TrajStat的后向轨迹聚类分析实战:从数据准备到可视化制图

本文详细介绍了基于Meteoinfo与TrajStat进行后向轨迹聚类分析的完整实战流程。从Java环境配置、Meteoinfo软件与TrajStat插件安装,到精准获取NOAA气象数据、设置参数进行批量轨迹计算,再到利用聚类分析提炼主要气流路径,并最终完成专业地图可视化与制图。文章旨在帮助环境与气象研究者快速掌握从数据准备到成果输出的全链路操作。

p4q5r6s7t的博客 810

从Stereo-seq原始数据到Seurat对象:华大空间转录组分析流程实战解析

本文详细解析了从Stereo-seq原始数据到Seurat对象的完整分析流程,重点解决华大空间转录组数据处理中的三大痛点:bin_size参数设置、批量处理内存管理及格式转换信息丢失。通过Python的stereopy库和R的SeuratDisk包,实现.gem到.h5ad再到.h5seurat的高效转换,为研究者提供了一套可复用的空间转录组分析解决方案。

weixin_30315723的博客 221

Struts2 学习笔记3

目录目录 struts2 学习 案例一使用Struts2框架完成登录功能 案例一使用Struts2作为WEB层完成客户的新增功能 案例一使用Struts2框架查询所有的客户功能struts2 学习案例一:使用Struts2框架完成登录功能需求分析1. 使用Struts2完成登录的功能 技术分析之Struts2框架的概述1. 什么是Struts2的框架 * Struts2是Struts1的下一

吴杨的博客 495

Modbus通信从入门到精通_2_Modbus TCP通信详解及仿真(搭建ModbusTCP仿真环境:创建虚拟PLC并进行ModbusTCP通讯;寄存器与PLC中映射关系;适合理解如何编写上位机)

LocalPort”是PLC的端口,最终的设置如下图所示:(相关的设置都可以查看帮助文档)P#DB1.DBX0.0 BYTE28是以指针形式表示的DB1的DBX0.0开始(在使用的西门子Modbus tcp的程序块中设置的“MB_HOLD_REG”输出寄存器),其有28个字节(28个字节对应14个寄存器),4001是第一个寄存器,往后数14个即可。在上面的基础上,增加一个“DB1”的“组对象”,同时将“MW0”的组对象禁止(双击组对象,“Active”取消勾选),启动之后发现无法连接。

分享学习成长历程,Winter is coming! 1万+

struts2学习笔记(3)

 第三讲 类型转换在网页上传输的数据均是以String类型来传输的,而当我们对这些数据进行处理的时候。不可能都是使用String,这就需要用到类型转换,struts2提供了非常强大的类型机制,首先,对于将String转换为int等简单类型,struts2已经提供,不需要我们再作任何的考虑了。struts2甚至提供了从String转换到Date这样的对象类型的类型转换。而如果我们有一些自己定

默然说话 2526

YOLO26创新改进 | 全网独家创新篇、小目标检测专属 | AAAI 2025 | 引入HS-FPN中的HFP和SDP创新点,从频域增强小目标特征,淘汰FPN进行升级,助力YOLO26有效涨点

本文提出HS-FPN特征金字塔网络,通过高频感知模块(HFP)和空间依赖感知模块(SDP)优化YOLO26模型。HFP利用高通滤波器增强小目标的高频特征,SDP捕获相邻像素的空间依赖关系。在AI-TOD等小目标检测数据集上,HS-FPN相比传统FPN显著提升性能。文章详细介绍了HFP和SDP的模块结构、核心代码实现,以及如何在YOLO26中集成这两个模块的配置方法,提供了多个版本的yaml文件配置方案。实验结果表明该方法能有效改善微小目标检测效果。

Ai缝合怪、助力小伙伴高效发论文 211

从零开始学 PyTorch 7天路线图(完整可运行代码版)

本文提供了5天PyTorch入门教程的完整代码,涵盖从基础到实战的核心内容。Day1测试环境并介绍张量基础;Day2讲解常用张量操作;Day3演示自动求导机制;Day4实现完整线性回归模型;Day5构建MNIST手写数字识别全连接网络。所有代码可直接运行,包含GPU检测、梯度计算、模型训练和可视化等关键环节,帮助新手快速掌握PyTorch核心概念和典型应用场景。

IT老农民的博客 323

Struts2 学习笔记 3

一、新建项目 1,新建web项目~ 2,修改web.xml struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter struts2 /* 仔细观察可发现此过滤器使用的是StrutsPrepareAndExecuteFilter,之前项目使用的是Fi

拉你手跟我走的专栏 356

“华为杯”研究生数学建模竞赛2020年-【华为杯】B题:汽油辛烷值优化建模(附优秀论文)

摘 要:本文通过机器学习算法和数据挖掘技术,建立了汽油辛烷值(RON)损失的预测模型,在保证汽油产品脱硫效果的前提下,以降低汽油辛烷值损失在30%以上为目标,给出每个样本的优化操作条件。针对第一问,对285号和313号原始数据用给定的数据处理规范进行预处理,对每一列变量求期望,得到最终的数据补充到相应的样本编号。针对第二问,首先对数据样本按照最大最小限幅以及拉依达法则进行列变量清洗,通过两轮特征筛选确定变量:结合处理后的数据,针对产品中硫含量、RON损失值用。

getusushu的博客 1253

Struts2学习笔记(3)

五、Struts2请求扩展名问题 配置Struts2可以受理请求的扩展名 可以通过设置value里面的值来配置。Struts2默认的扩展名是action。 六、struts2示例代码 登录->统计线人数(登录用户名)->退出减少在线人数(只实现功能,未考虑过多逻辑问题) Struts配置:                                       

Hai_Eason的博客 344

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

浪曦struts2学习笔记3

类型转换流程: 1 input.jsp form的action指向pointConverter 2 到配置文件struts.xml里面找到对应的action,该action指向的class为com.test.action.PointAction 3 在com.test.action包中找到PointAction.java,age username date 根据类中的set方法,给类中的3

u011574965的博客 290

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Struts2学习笔记3_Struts2的加载执行解释

1. web服务器启动时会加载web.xml文件中的类,当初始化StrutsPrepareAndExecuteFilter过滤器类时,当执行该过滤器的init()方法时将会读取类路径下默认的配置文件struts.xml来完成Action的初始化操作。 2. Action以javaBean形式存放在内存中,以后struts2对用户的每次请求处理都将使用内存中的数据,而不是每次都读取struts.x

tongle_deng的专栏 377

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

struts2学习笔记(3)——标签、其他

与jstl标准标签库类似的,struts有专属标签库 form标签用于提交数据修改addProduct.jsp&lt;html&gt; &lt;body&gt; &lt;s:form action="addProduct"&gt;   &lt;s:textfield name="product.name" label="product name" /&gt;  &lt;s:su

qq_34230513的博客 275

struts2+spring3+hibernate3学习笔记

1.struts中的set与get方法: struts中的set方法可以获得页面上传过来的值,get方法可以把值传到页面上去。

zsx0321的专栏 732

Struts2学习笔记(3)

1.   文件下载 1.1传统方式 /** * TODO用传统的方式实现文件下载  *优点:运用传统的web只是,好理解  *缺点:在Action中引入了Servlet的api,导致struts2和servlet耦合  */ publicclass DownloadActionextends ActionSupport {       private Stringfile

枫叶的专栏 1072

Struts2学习笔记(3)——第一个 struts2工程

工具:myeclipse、struts2 jar包(官网下或者myecplise自带)1、新建一个web project2、导入所需jar包在lib中导入如下包(标红的为必需的与常用的),复制到lib文件夹下即可。 3、编写web.xml<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://

xxxknight 481

struts2入门学习笔记(1) struts2.3

说明:本笔记内容只是struts2初级使用,是对网络上《struts2入门教程》教程学习的总结内容。 1.简单介绍       (1)在软件设计上Struts2没有像struts1那样跟Servlet API和struts API有着紧密的耦合,Struts2的应用可以不依赖于Servlet API和struts API。 Struts2的这种设计属于无侵入式设计,而Struts1却属...

iteye_11031的博客 162

Struts2学习笔记(3)之国际化

国际化 配置国际化全局资源文件 1.        准备资源文件,资源文件命名格式:例如 中国大陆:baseName_zh_CN.properties 美国:baseName_en_US.properties 在资源文件中以键-值的形式表现出来。 2.        在struts.xml中通过struts.custom.i18n.resources常量把资源文件定义为全局资源文件:

鹏哥技术博客 620

【Struts2学习笔记】3:Struts2中Action和result处理的配置

配置Action 在struts.xml中的包下,格式是: ... &lt;package ...&gt; &lt;action name="Action的名称" [class="实现类所在的java包.实现类名"]&gt; ... &lt;/action&gt; &lt;/package&gt; ... 这里所指定的Action名称,即对应请求Actio...

大桔骑士的学习笔记 2326

Struts2,Spring3,Hibernate学习笔记

看的李刚的《轻量级JavaEE实战》 -----------Struts2----------1.Struts2在项目中的配置:首先,web.xml中配置Filter<filter><filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatche...

weixin_30856965的博客 114

【Struts2学习笔记-3】常量配置

Struts2常量配置Struts2常量值有3个地方,1)在struts.properties文件中配置常量;2)在web.xml文件中配置FileterDispatcher指定初始化参数来配置常量;3)在struts.xml文件中使用&lt;constrant.../&gt;元素来配置常量。下面详细说说第一种方式。1. struts.configuration: 该常量指定加载struts2配置...

weixin_34401479的博客 88

Struts2学习笔记3 ――基于AJAX的表单验证

Struts2学习笔记3 ――基于AJAX的表单验证基于AJAX的表单验证需要先安装DWR,在http://getahead.ltd.uk/dwr/download上下载DWR 2.0 RC 2,将dwr.jar拷贝到WEB-INF/lib目录下1.修改web.xml,另入DWR支持: servlet>        servlet-name>dwrservlet-name>   

楓雨人生 5780
上一篇: Struts2学习笔记2
下一篇: Struts2学习笔记4
cppmayi
博客等级 码龄19年 0粉丝 13原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值