Struts OGNL if 与操作类变量相关的语句不起作用,
问题是: 在我的操作类中,我有一个变量:
private String commentAdd = "yes";
操作类转到 reslut.jsp,在 reslut.jsp 中我有:
<s:set name="allowAddComment" value="commentAdd"/>
<s:if test="%{#allowAddComment=='yes'}">
<script type="text/javascript">
window.close();
</script>
</s:if>
但它不起作用,一些专家能给我一些建议吗?谢谢。
The problem is:
Inside my action class, i have one variable:
private String commentAdd = "yes";
And the action class goes to reslut.jsp, inside reslut.jsp i have:
<s:set name="allowAddComment" value="commentAdd"/>
<s:if test="%{#allowAddComment=='yes'}">
<script type="text/javascript">
window.close();
</script>
</s:if>
but it doesn't work, can some expert give me some suggestion? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几件事。
您确定这确实是您想要的吗?这将在 JavaScript 渲染后尽快关闭窗口。如果可以的话,很好——但如果是这样的话,为什么还要费心渲染窗口呢?
A few things.
Are you sure this is really what you want? This will close the window as soon as that JavaScript is rendered. If that's okay, fine--although if that's the case, why bother rendering the window at all?
}
}