<s:if test=${my:hasPermission(user.id,'person',3)}>
<a href="#" onclick="del('per!delete?perInfo.id=<s:property value="id"/>');">删除</a>
</s:if>据说struts2不兼容EL,需要用ognl表达式,但是我不知道如何使用,请教高手给段代码。
<s:if test=${my:hasPermission(user.id,'person',3)}>总是出错,报错:quote symbol expected
hasPermission单元测试没错,请教。
<a href="#" onclick="del('per!delete?perInfo.id=<s:property value="id"/>');">删除</a>
</s:if>据说struts2不兼容EL,需要用ognl表达式,但是我不知道如何使用,请教高手给段代码。
<s:if test=${my:hasPermission(user.id,'person',3)}>总是出错,报错:quote symbol expected
hasPermission单元测试没错,请教。
如果s:if不支持的话,可以考虑c:if(JSTL标签)。
一楼正解啊。ongl表达式是要用""括起来的,Struts2官方文档里面的实例代码如下:<s:if test="%{false}">
<div>Will Not Be Executed</div>
</s:if>
<s:if test="%{my:hasPermission(user.id,'person',3)}">