如何指定< s:property value =" a">值为jsp变量 [英] How to assign <s:property value="a"> value to a jsp variable
本文介绍了如何指定< s:property value =" a">值为jsp变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人能说出如何将一个来自< s:property value =a>
的值分配到jsp变量中吗?
Can anybody tell how to assign a value coming from "<s:property value="a">"
into jsp variable ?
推荐答案
你可以使用s:set标签。
You can use the s:set tag for this.
例如,这将从您的操作调用getA()并将值放入avalue,不要使用 name 而不是 var
For example this will call getA() from your action and put the value into "avalue", don't use name instead of var
<s:set var="avalue" value="a" />
然后你可以在JSP上像这样引用它:
And then you can reference it like so on the JSP:
<b>Print value defined in set tag :</b> <s:property value="#avalue" /> <br/>
这将打印出该值。
这篇关于如何指定< s:property value =" a">值为jsp变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文