views:

9

answers:

1

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

<html:select property="myMap(<%=MyClass.FIELD%>)"> , but that didn't work.

What's the correct syntax here?

+3  A: 

Try the following:

<% String name = "myMap(" + MyClass.FIELD + ")"; %>
<html:select property="<%=name%>">
Andy
This works, but I wish there was a slicker inline way :/
Stefan Kendall
Oh, duh! You can just inline the whole addition, and you're good.
Stefan Kendall