开发者

How to interpolate java expressions in struts attribute strings

I have the following:

<html:select property="myMap(abc)">

What I really need to do, however, is pull the string abc from a static member of a java class.

I thought something like

&l开发者_如何学运维t;html:select property="myMap(<%=MyClass.FIELD%>)"> , but that didn't work.

What's the correct syntax here?


Try the following:

<% String name = "myMap(" + MyClass.FIELD + ")"; %>
<html:select property="<%=name%>">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜