ognl 表达式的应用

1,取得action上下文

     #parameters.id[0]   相当于request.getParameter["id"];

     #reqeust.userName; 相当于 request.getAttribute("userName");

     同理session  application

2,过滤和投影集合

       集合的过滤有三种方式

     ?#: 过滤所有符合条件的集合  us>ers.{?#this.age>19}

     ^#:过滤符合条件的集合的第一个 user.{^#this.age>19}

     $#:过滤符合条件的集合的最后一个元素 user.{$#this.age?19}

     this表示集合中的元素 

     过滤操作返回的是一个集合,可以使用索引取得集合中指定的元素,如:user.{?#this.age>19}[0].
3,构造map  如#{'name1':'zhang','name2':'li'} 

深入解析Java中OGNL表达式语言的核心应用与实战技巧 本文深入解析Java中OGNL表达式语言的核心应用与实战技巧,涵盖属性访问、方法调用、集合操作等核心功能,并分享动态规则引擎实现、安全防护方案等高级应用场景。通过性能优化实战经验和常见问题排查指南,帮助开发者高效使用OGNL提升开发效率。 阅读详情

相关推荐

Unity中URP实现水体效果(泡沫)

在上篇文章中,我们实现了水体的深度。在这篇文章中,我们来使用上篇文章采样后的深度图来实现水中的泡沫效果。

楠溪泽岸的博客 3489

OGNL表达式原理及使用

OGNL:object graph navigation language,对象图形导航语言,一种表达式语言。 为什么出现: 在我们所熟悉的mvc框架中,数据是在各层之间进行流转使用的。 显示层:将数据展示给用户,数据不分类型,统一按照字符串处理 后台:处理数据,在java中数据分为很多类型,我们可以自行定义。 这样在页面和java中数据的传递使用就会出现不匹配的

淡泊明志,宁静致远 3592

从零开始,用MATLAB/Simulink手把手搭建一个无刷直流电机(BLDC)的控制模型

本文详细介绍了如何使用MATLAB/Simulink从零开始搭建无刷直流电机(BLDC)控制模型。通过可视化建模方法,避开繁琐的数学推导,直接构建三相逆变器、电机本体参数化模型、霍尔传感器与换相逻辑实现,以及速度闭环控制设计。文章还提供了PID控制器整定、抗饱和处理和系统调试的实用技巧,帮助工程师快速掌握BLDC控制系统的仿真与实现。

weixin_27741699的博客 254

OGNL表达式用法详解

表达式通常用来访问页面中的各种变量,进行结果输出. struts2中共支持以下几种表达式语言(默认的是OGNL): (1)OGNL:可以方便地操作对象属性的开源表达式语言; (2)JSTL:(JSP Standard Tag Library):JSP2.0集成的标准表达式语言; (3)Groovy:基于Java平台的动态语言,它具有时下比较流行的动态语言的一些特性; (4)Velocit...

木子李的博客 1万+

用Matlab系统辨识工具箱搞定温控系统建模:从阶跃响应到传递函数(附完整代码)

本文详细介绍了如何使用Matlab系统辨识工具箱进行温控系统建模,从阶跃响应数据采集到传递函数参数辨识的全过程。通过实际案例和完整代码,帮助工程师快速掌握PID控制参数整定技巧,提升温控系统设计效率。特别适合单片机开发者和自动化控制工程师参考。

weixin_30736301的博客 309

(8)机器人动力学

机器人是一个具有多输入多输出的复杂动力学系统,存在严重的非线性,需要非常系统的方法对机器人进行动力学研究。常用的机器人动力学建模方法有:Lagrange(拉格朗日)动力学方法、Newton-Euler(牛顿-欧拉)动力学方法、Gauss(高斯)动力学方法、Kane(凯恩)动力学方法等。机器人动力学研究的是机器人的运动和作用力之间的关系。机器人的动力学问题包括动力学正问题和动力学逆问题。动力学正问题是对于给定的关节驱动力......

rouyu308的博客 9498

ognl表达式入门应用

[code="java"]package foo.test; public class User { private Person person; private String username; private String sex; public String getSex() { return sex; } public void setSe...

jin_yan_liang的专栏 126

多角度模板匹配的模板创建技巧

基于形状的模板匹配多角度创建技巧

manuoo的专栏 3402

Struts2标签——OGNL表达式在Struts2中的应用

上一章节学习了OGNL在struts2上应用的体现,分别是参数的获取、配置文件中数据的传递,还有一个是struts2标签,但是在上一章节没有记录,本章节进行学习记录~ Struts2标签——OGNL表达式在Struts2中的应用Struts2标签——OGNL表达式在Struts2中的应用1、控制标签2、数据标签3、表单标签4、非表单标签 Struts2标签——OGNL表达式在Struts2中的...

༺清风暖云༻ 842

SAP 52策略测试简介

我们看下下层物料的需求,可以看到物料的需求已经跑出来了,我们双击计划订单,发现是没有办法将计划订单转换为采购申请的,这里是否还记得我们在前面创建主数据的时候独立集中我们填写的是1,所以物料继承了上层物料的策略,所以不能将计划订单进行转换。我们在前面测试了50策略按单生产,创建完计划独立需求后,通过主数据中的独立集中的字段控制下层物料是否能通过计划订单转成生产订单和采购订单。可以看到下层物料的计划订单就可以转采购申请了,到这里可以看到52策略和50策略的计划独立需求完全是一样的。

我小时候很黑的博客 1272

【AutoSAR】【BootLoader】AutoSAR Bootloader 原理与流程

目录 一、HIS规范 二、BOOTLOADER软件架构 三、烧写流程 一、HIS规范 国外整车厂意识到在线刷新ECU的重要性,由奥迪公司、宝马公司、戴姆勒公司、保时捷公司、大众公司成立一个委员会,名为HIS委员会,专门负责帮助汽车制造商掌握微处理器控制单元软件和质量保证领域的原理和方法; HIS Bootloader的主要功能是通过标准的通信接口对ECU进行再编程 。 HIS Bootloader的软件设计基于AUTOSAR体系架构、ISO14229、ISO15765-2、HI...

专注汽车软件开发、AutoSAR、车载以太网、SOA、EE架构。 5247

Ognl表达式的应用,语法,及如何获取数据root,ContextMap

1. OGNL表达式 (对象图导航语言) OGNL是Object-Graph Navigation Language的缩写,翻译过来就是 对象视图导航语言 , 它是一种功能强大的表达式语言,通过它简单一致的表达式语法,可以实现: 可以存取对象的任意属性, 可以调用对象的方法, 遍历整个对象的结构图, 实现字段类型转化等功能。 它使用相同的表达式去存取对象的属性。 EL(Expression L...

Java开发,人工智能,边缘计算,致力于掌握前沿技术 1293

基于Java+SpringBoot+微信小程序实现奶茶点单系统

再不用担心逢年过节的第一杯奶茶有没有人送了,制作一个奶茶点单系统自己当店主,开怀畅饮,一劳永逸。

商务合作 / 项目定制 / 学习交流。个人vx:lovely_wml 1万+

ognl表达式应用场景和用法

ognl表达式的用法和应用场景 1.配置文件 //书写方式是:'${@类全限定名@常量}' dic_city.type=${@com.imooc.constant.DictionaryConstant@TYPE_DICTIONARY_CITY} 2.xml <update id="refuseDebt"> UPDATE dt_deb...

diangan2660的博客 371

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

OGNL表达式与struts2整合应用

OGNL:网上查阅。 Object-Graph-Navigation-Language的缩写,全称对象视图导航语言。在jsp中同EL表达 式有相似之处,但功能较之强大。可以存取对象的任意属性,调用对象的方法,遍历整个对象的结构图,实 现字段类型转化,操作集合等功能。并不属于struts2开...

chousheng1613的博客 135

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Arthas高级用法:OGNL表达式在Java诊断中的10个巧妙应用技巧

Arthas作为阿里巴巴开源的Java诊断利器,其强大的OGNL表达式功能为开发者提供了前所未有的诊断能力。本文将深入探讨Arthas OGNL表达式在Java应用诊断中的10个高级应用技巧,帮助您快速定位和解决复杂的线上问题。💡 ## 什么是Arthas OGNL表达式? OGNL(Object-Graph Navigation Language)是Arthas中一个强大的表达式语言,它允

gitblog_00219的博客 827

深度学习工具包 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")

深入解析:OGNL表达式在Mybatis动态SQL中的实战应用

本文深入解析了OGNL表达式在MyBatis动态SQL中的核心应用。OGNL作为对象图导航语言,能够简化Java对象属性的访问,并支持方法调用、集合操作与逻辑判断,是实现动态条件查询、排序、字段选择等复杂SQL逻辑的强大工具。文章通过实战案例详细展示了其语法与高级用法,并强调了性能优化与安全使用的重要性。

tree8的博客 209

JSP开发中OGNL表达式与指令结合的优势及应用场景解析?

在JSP开发中,OGNL表达式与指令的结合使用能够显著提升数据处理的灵活性和效率。通过OGNL,我们可以在JSP页面上更直观地访问和操作后端数据

2509_93883384的博客 319

Ognl表达式的应用(无原理介绍)

Struts2内置ognl表达式。引用valueStack概念。将值放入其中,可直接调用。 --要配合Struts2标签 无原理介绍。 ​ ​一.取值 1.直接读取valueStack中的值 假设action中有private Cat cat, private Dog dog. ​ ​​​读取cat name属性的值 读取

FewMore的博客 405

深入解析Java中OGNL表达式语言的核心功能与应用实践

本文深入解析Java中OGNL表达式语言的核心功能与应用实践,涵盖基础语法、上下文环境、集合操作等高级特性,并提供企业级实战案例与安全优化方案。特别适合需要处理复杂对象导航和动态计算的Java开发者,通过OGNL实现简洁高效的代码逻辑。

weixin_30919429的博客 362

OGNL表达式

1 2 OGNL是从ActionContext中获取数据的。 3 4 ActionContext的结构: 5 ValueStack: 6 List:动作类放在此处。取存放在ValueStack中的root的对象的属性,直接写即可 7 8 访问以下...

weixin_34380296的博客 77

Struts2中的OGNL详解

首先了解下OGNL的概念: OGNL是Object-Graph Navigation Language的缩写,全称为对象图导航语言,是一种功能强大的表达式语言,它通过简单一致的语法,可以任意存取对象的属性或者调用对象的方法,能够遍历整个对象的结构图,实现对象属性类型的转换等功能。 此外,还得先需弄懂OGNL的一些知识: 1.OGNL表达式的计算是围绕OGNL上下文进行的。 OGNL上下

Java高知社区 9万+

不带struts2的纯OGNL的例子

pure OGNL example without struts2,for the benefit of your completely understanding it. public class User { private String name; public String getName() { return name; } pu

刘利新西安 562

Strut2:OGNL表达式

OGNL是Object-Graph Navigation Language的缩写,它是一种功能强大的表达式语言,通过它简单一致的表达式语法,可以存取对象的任意属性,调用对象的方法,遍历整个对象的结构图,实现字段类型转化等功能。它使用相同的表达式去存取对象的属性。

静墨的博客 500
上一篇: ssh 异常
下一篇: 工作中的一个列子
smartfirstme
博客等级 码龄18年 1粉丝 179原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值