However, I really nee...">

Interpolating java expressions in struts attribute strings

I have the following:

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

However, I really need to make a string abcfrom a static member of the java class.

I thought something like

<html:select property="myMap(<%=MyClass.FIELD%>)"> but it didn’t work.

What is the correct syntax here?

+3
source share
1 answer

Try the following:

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

Source: https://habr.com/ru/post/1771610/


All Articles