如何在struts标记中获取JSP scriptlet值 [英] How to get JSP scriptlet value in struts tag

查看:60
本文介绍了如何在struts标记中获取JSP scriptlet值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

<% request.setAttribute("lcItem", "Hello"); %>

如果执行以下操作,则无法获取该值:

If I do as following, I'm not getting the value:

<s:property value="%{lcItem}" />
<s:property value="lcItem" />

有什么建议吗?

推荐答案

这很完美..

<%       
   request.setAttribute("lcItem", LeftContentItem);
%>

<s:property value="#request['lcItem']" />

注意:根据我们使用的范围,我们应该指定#request .. etc

Note: According to the Scope we use we should specify the #request .. etc

这篇关于如何在struts标记中获取JSP scriptlet值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆