struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fumo, Vince" <Vince.F...@acs-inc.com>
Subject RE: status messages in <html:link> tag
Date Thu, 31 Mar 2005 18:54:47 GMT
ok follow-up and I'm sure this one will take 2 seconds to answer.. 

part 1) is there a JSTL way to do the <bean:define>? 
part 2) What does it mean when the status message from the below code by Bob
comes out as a literal (i.e.. <%=rollOverText%>) instead of the string it
represents? I've checked the scriptlet outside of the tag and it outputs
correctly. I'm thinking that the <html:link> tag isn't pre-processing the
scriptlet?

-----Original Message-----
From: Bob Arnott [mailto:boba@aungate.com]
Sent: Thursday, March 31, 2005 12:41 PM
To: Struts Users Mailing List
Subject: Re: status messages in <html:link> tag


Fumo, Vince wrote:
> I want to implement a status message on a rollover for some of my links. I
> was considering doing something like:
> 
> <html:link href="http://www.google.com" target="_blank"
> onmouseover="window.status='Go go google';return true">
> 
> which works fine. 
> 
> However, what I really want to do is pull the status message from my
struts
> message-resources bundle for I18N. The only way I can think to do this is
to
> use a scriptlet like :
> 
> <html:link href="http://www.google.com" target="_blank" 
> onmouseover="window.status='<% getMessage("message.key");%>';return true">

Off the top of my head, you could try something like this -

<bean:define id="rollOverText" type="java.lang.String"><bean:message
key="my.key" /></bean:define>
<html:link href="http://www.google.com" target="_blank"
onmouseover="window.status='<%=rollOverText%>'; return true;">...

-- 
Bob Arnott


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message