返回文章列表
使用OGNL
使用OGNL $和%以及#的区别 在struts标签里,一律用%{Name},在页面上直接写${Name},如: ${newsEntry.author} 等价于如下struts标签: <s:property value="%{newsEntry.author}" /> 如果%{}...
使用OGNL $和%以及#的区别
在struts标签里,一律用%{Name},在页面上直接写${Name},如: ${newsEntry.author}
等价于如下struts标签: <s:property value="%{newsEntry.author}" />
如果%{}里面不是计算表达式,也可以直接写为: <s:property value="newsEntry.author" />
#用于调用方法,如${newsEntry.author}是获取名为author的属性,即通过调用newsEntry.getAuthor()方法得到值,而${#newsEntry.size}则是调用newsEntry.size()方法,将结果输出
评论交流
暂无评论,欢迎留下你的想法