Johan Compagner <[EMAIL PROTECTED]> wrote:
> because i can't do this:
>       <bean:message arg0="<%=
> insurance.getProperty("totalautotheft").toString()
> %>"
>
> I find this a bug of the Tomcat parser if you ask me. Because
> if he sees that it is a reqexpr (<%=)
> then it should first find the %> before looking at the closing "!!

Is it the quotes inside quotes that are messing you up? Try single
quotes around the <%= %> expression, like this:

<bean:write name="editForm"
  property='<%= "components[" + index + "].description" %>'/>

That's straight out of one of my pages and it works fine. A pain, I
admit, but it works. I think I also saw a suggestion when searching the
struts-user list yesterday about leaving off the outer quotes entirely,
but that will probably only work if your result string has no spaces.
(For property, it has to, so that one's probably safe.)

However, the idea of having subtags defining or supplementing tag
attributes, which Michael Westbay mentioned, sounds very appealing. I've
often wanted to use a <bean:write> in a tag argument, but instead had to
move the value into a Java variable and use "<%= %>" for the tag
attribute. Being able to specify certain attributes, like values and
property names in subtag bodies would solve that nicely.

--
Michael Hackett
Developer, Pictorius Inc.

Reply via email to