For the record, here's the general solution as well, for situations where you can't use the element body like that. First, defining a scripting variable:

  <c:set var="msg"><fmt:message key="msg.key"/></c:set>
  <x:yyy ... attr="${msg}"/>

Or, to avoid the scripting variable, you can use jsp:attribute:

  <c:yyy ...>
    <jsp:attribute name="attr">
      <fmt:message key="msg.key"/>
    </jsp:attribute>
  </c:yyy>

This comes up on the list so often, I think I'll add an FAQ page to the wiki :-)

L.

Ed Griebel wrote:
I use this idiom all the time to get a message label on a button:
        <html:submit property="button" styleClass="longButton">
                <bean:message key="button.confirm"/>
        </html:submit>

You should be able to substitute <fmt:message> above.

-ed


On 11/22/05, Wendy Smoak <[EMAIL PROTECTED]> wrote:

On 11/22/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:

Ok, today is apparently the day I get to ask a bunch of stupid questions...

Why doesn't this work?

<html:submit styleClass="cssButton" value="<fmt:message
key="labels.loginButton" />" />

You can't use a JSP tag as attribute of another JSP tag.

Maybe try <c:set> with the fmt in the body, then use an expression for
the value of <html:submit>?   Which implies the use of the Struts-EL
taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.

If you haven't already, change the URI in <%@ taglib> and leave the
prefix as 'html'.

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to