- 浏览: 1091715 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (401)
- tomcat (7)
- win7 (13)
- stackOverflow (6)
- 1 (0)
- css (5)
- develop IDE (9)
- hibernate (16)
- struts2标签 (10)
- struts2 (25)
- 框架 (1)
- SQLserver2005 (20)
- 词汇解释 (1)
- views (1)
- eclipse (6)
- 效率提高 (12)
- 代码模块 (1)
- 源代码 (3)
- jsonplugin (5)
- ajax (2)
- json (3)
- ssis (14)
- 电脑故障 (10)
- oracle (12)
- poi;excel (5)
- sql (3)
- 正则表达式 (3)
- develop IDEk (8)
- myeclipse (14)
- win2003 (5)
- 正则表达式;js (2)
- js (27)
- 待解决 (2)
- ognl (1)
- com组件 (1)
- 游戏 (6)
- 线程 (0)
- 硬盘 (4)
- 格式化 (2)
- java (7)
- html (9)
- firebug (1)
- jquery (4)
- 文件上传下载 (1)
- vss (2)
- 触发器 (1)
- spring事务管理 (2)
- 模态对话框 (1)
- SQLserver2000 (1)
- web性能优化 (2)
- web安全 (1)
- jetty (1)
- 路由器 (1)
- ie6 (1)
- 缓存 (1)
- jsp (1)
- struts2源代码 (1)
- 方法 (1)
- uml (1)
- ie (3)
- Java日志框架 (1)
- myeclipse,oracle (1)
- freemarker (4)
- 注解 (4)
- svn (2)
- hadoop (15)
- lucene (1)
- word (1)
- spring (5)
- job (1)
- extjs (4)
- paxos (1)
- zookeeper (1)
- 分布式 (1)
- 手机故障 (2)
- maven (2)
- linux (9)
- 虚拟机 (1)
- ext (3)
- javascript (1)
- 数据库 (5)
- 多线程 (12)
- junit (2)
- utils (1)
- mybatis (4)
- Joda-Time (1)
- tftp (1)
- scala (12)
- Graphic2D (1)
- jsf (5)
- 《java并发编程实战》笔记 (16)
- storm (3)
- 设计模式 (3)
- 泛型 (2)
- 数学 (1)
- primeface (1)
- poi (5)
- 线性代数 (1)
- 动态代理 (3)
- mysql (2)
- DB2 (2)
- testNG (1)
- 虚拟机、编译器、增量发布 (1)
最新评论
-
zhouchaofei2010:
Saro 写道在log4j配置里把mapper所在包设为deb ...
mybatis出现sql异常时的日志优化-打印sql参数 -
Saro:
在log4j配置里把mapper所在包设为debug就行了,参 ...
mybatis出现sql异常时的日志优化-打印sql参数 -
pyl574069214:
...
poi Excel 水平居中 垂直居中 -
zhouchaofei2010:
杀手请杀人 写道能看到scala太难得了 谢谢
scala 下划线解析报错: missing parameter type for expanded function -
杀手请杀人:
能看到scala太难得了
scala 下划线解析报错: missing parameter type for expanded function
“#”主要有三种用途: %”符号的用途是在标志的属性为字符串类型时,计算OGNL表达式的值。例如在Ognl.jsp中加入以下代码:
访问OGNL上下文和Action上下文,#相当于ActionContext.getContext();下表有几个ActionContext中有用的属性: 名称 作用 例子
parameters 包含当前HTTP请求参数的Map #parameters.id[0]作用相当于request.getParameter("id")
request 包含当前HttpServletRequest的属性(attribute)的Map #request.userName相当于request.getAttribute("userName")
session 包含当前HttpSession的属性(attribute)的Map #session.userName相当于session.getAttribute("userName")
application 包含当前应用的ServletContext的属性(attribute)的Map #application.userName相当于application.getAttribute("userName")
attr 用于按request > session > application顺序访问其属性(attribute) #attr.userName相当于按顺序在以上三个范围(scope)内读取userName属性,直到找到为止
用于过滤和投影(projecting)集合,如books.{?#this.price<100};
构造Map,如#{'foo1':'bar1', 'foo2':'bar2'}。
例1:
<hr />
<h3>%的用途</h3>
<p><s:url value="#foobar['foo1']" /></p>
<p><s:url value="%{#foobar['foo1']}" /></p>
例1:
<s:iterator id="JxwD2" value="#session.JxwDs" >
<s:hidden name="hiddenId" value="%{#JxwD2.id}"></s:hidden>
</s:iterator>
“$”有两个主要的用途
用于在国际化资源文件中,引用OGNL表达式,例子请参考《在Struts 2.0中国际化(i18n)您的应用程序》
在Struts 2配置文件中,引用OGNL表达式,如
<action name="AddPhoto" class="addPhoto">
<interceptor-ref name="fileUploadStack" />
<result type="redirect">ListPhotos.action?albumId=${albumId}</result>
</action>
发表评论
-
struts2 下载不弹出下载对话框
2012-12-19 17:15 2123如下配置可以: <action name=&quo ... -
getResourceAsStream
2012-12-19 17:00 2535getResourceAsStream http:// ... -
struts2访问WEB-INF文件下内容
2012-11-29 17:30 48031、 WEB-INF下内容,通过浏览器下无法直接访问 2、 ... -
struts2标签判断字符串
2012-11-14 13:24 83111:<s:property value='#at ... -
struts2附件上传,大小超过最大值处理
2012-06-20 14:19 3364Action: /** * 当上传文件大小大 ... -
struts2 action resultType ajax
2012-06-06 11:17 999概要: 如何在st ... -
Struts2中使用OGNL标签_s:if and 运算
2012-06-04 16:19 8742Struts2中使用OGNL标签_s:if and 运算 ... -
数据操作后,页面alert提示例子
2012-04-19 15:16 1004在页面开头插入如下例子代码 <s:if test ... -
struts2 格式化输出日期yyyy-MM-dd
2012-03-26 11:17 17451、直接页面输出 <s:date nam ... -
defaultStack已经包含了fileUpload的拦截器。具体的action不用再另外配置fileUpload的拦截器
2012-03-19 19:42 1039struts2.0.11 的defaultStack已经包含 ... -
struts2 property 不起作用
2012-03-16 11:41 1307<s:select id="select_s ... -
s:hidden value用property标签赋值不起作用
2012-03-07 17:23 4850<s:property value="titl ... -
struts2的重定向带参数
2012-03-06 23:28 0redirect。。。。 -
jsp 调试输出值
2012-03-06 22:46 1204比如有代码 <s:if test="#gdzc ... -
s:date标签使用时,一定要是Date类型
2012-02-02 13:28 956s:date标签使用时,一定要是Date类型。 St ... -
struts2 ognl 传递参数原理及过程
2011-12-31 17:22 1038struts2 ognl 传递参数原理及过程 -
struts2 jsonplugin includeProperties中对list集合的正则配置
2011-12-29 21:21 36271、listAttachment.*\.realName ... -
struts2 jsonplugin includeProperties 对list集合的正则配置
2011-12-29 21:18 4833jsonplugin 0.32 0.34 官方下载 ... -
struts2的重定向与转发配置
2011-12-27 16:18 1217<result name="success&q ... -
struts2,select对list集合数据回显
2011-12-17 20:48 7021方法一:list<String> 改为 l ...
相关推荐
struts2 中 OGNL表达式的使用struts2 中 OGNL表达式的使用
struts2中ognl表达式的用法,详细介绍了ognl表达式与struts2基本标签的结合。
struts2OGNL表达式ActionContext及valuesStack.pdf
Struts 2默认的表达式语言是OGNL,原因是它相对其它表达式语言具有下面几大优势: 1、 支持对象方法调用,如xxx.doSomeSpecial(); 2、支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路径)]@...
NULL 博文链接:https://chaoyi.iteye.com/blog/2158731
struts2 OGNL,struts2 表达式语言,Struts2 中OGNL表达式的用法,Struts2 #,表达式语言的好处,Struts2 $,struts2 井号,星号,百分号
Struts2的标签库及OGNL表达式语言
OGNL是对象图导航语言(即该表达式访问的是对象及对象的属性)
struts2标签和OGNL表达式struts2标签和OGNL表达式
主要介绍了Struts2 OGNL表达式实例详解,相关实例代码,需要的朋友可以参考。
struts2-OGNL表达式测试代码
NULL 博文链接:https://cdxs2.iteye.com/blog/1926840
NULL 博文链接:https://johnson2132.iteye.com/blog/720769
本资源适合刚接触Struts和Ognl的小伙伴交流学习,欢迎吐槽。
最近的项目开发中使用了struts2的框架,但是好多人都不清楚struts2的标签的具体的用法,要想完全掌握struts2标签的用法,那么你必须先精通了struts2中OGNL的用法。struts2中很多东西其实理解就行,但是惟独OGNL虽然...
NULL 博文链接:https://takeme.iteye.com/blog/1668255
ognl表达式在struts中的用法解析
struts2标签和OGNL表达式.pdf
1、 理解Struts2的类型转换类型 2、 理解局部类型转换器与全局类型转换器的区别 3、 掌握Struts2的自定义类型转换 4、 理解OGNL表达式语言
2、支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路)]@[方法名 | 值名],例如: @java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3、支持赋值操作和表达式串联,...