Struts2 Tag 标签

struts2 OGNL 中的#、%等符号的区别:
Apache Struts 2 Documentation -> OGNL:
[url]http://struts.apache.org/2.2.3/docs/ognl.html[/url]
Apache Struts 2 Documentation -> Tag Syntax:
[url]http://struts.apache.org/2.2.3/docs/tag-syntax.html[/url]
Struts 2: %{} or # :
[url]http://www.coderanch.com/t/420711/Struts/Struts-or[/url]
Setting the value in <s:textfield from request scope:
[url]http://www.coderanch.com/t/440061/Struts/Setting-value-textfield-request-scope[/url][quote][b]%{} is the OGNL escape. The # means it's an action context "scope" variable, not on the stack.
Again--there's zero reason to do it like this, and at least a couple reasons not to[/b].[/quote]


Js中取struts2标签s:autocompleter的值(版本:2.0.11.1):
<s:autocompleter theme="simple" id="steelgradeIdjh" name="qm.steelgradeId" list="steelgradesNameList" cssClass="textinput" forceValidOption="true" cssStyle="width:80" />
var obj = dojo.widget.byId("steelgradeIdjh");
alert(obj.getValue());



不要在普通html标签中嵌套struts2 ognl表达式。如这样的写法是错误的:
<input  type="text"  name="fidsDispTempdataList[%{#stas.index}].pages" id="fidsDispTempdataList[%{#stas.index}].pages" size="4">

正确的应该是:
<s:textfield id="fidsDispTempdataList[%{#stas.index}].pages" name="fidsDispTempdataList[%{#stas.index}].pages" theme="simple" value=""></s:textfield>


但是可以在普通html标签中嵌套struts2标签,如:
<input  type="text" name="fidsDispTemplate.code" id="fidsDispTemplate.code" value="<s:property value="fidsDispTemplate.code"/>" />
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值