Re: status messages in html:link tag
Fumo, Vince wrote: 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? Probably, but I've not used JSTL... 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? Irt was off the top of my head I I realise that I made an error - bean:define id=rollOverText type=java.lang.Stringwindow.status='bean:message key=my.key /'; return true;/bean:define html:link href=http://www.google.com; target=_blank onmouseover=%=rollOverText%... Is what you want (I think)... You can't mix the %= % bit inside a string within a tag attribute, if you get me. So attr=%= ... % is okay, but attr=string(%= ... %) isn't. Cheers, -- Bob Arnott Software Developer Autonomy Systems Ltd. Cambridge Business Park Cowley Road Cambridge CB4 0WZ T: +44 (0) 1223 448 000 F: +44 (0) 1223 448 001 http://www.aungate.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: status messages in html:link tag
On Mar 31, 2005 1:54 PM, Fumo, Vince [EMAIL PROTECTED] wrote: 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? c:set/ -- Jeff Beal Webmedx, Inc. Pittsburgh, PA USA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: status messages in html:link tag
Be careful using c:set over bean:define. The DefineTag creates both a scripting variable and a page scoped attribute, so you can use bean:define and then use that in any struts tag, jstl tag, or % scriptlet %, but not the same in reverse. If you do c:set, only the scoped var is created, so doing c:set var=myVal value=test/ and trying to use that in either logic:equal tag (for example) or a scriptlet, will fail. The work around for that (when using c:set) would be to use c:if test=${myVal == 'test'}/c:if Here's an example test.jsp 1 !--c:set var=val value=test/-- 2bean:define id=val 3test 4/bean:define 5c:out value=${val}/br/ 6%=val%br/ 7logic:equal name=val value=test 8 bean:write name=val/ 9/logic:equal This runs fine, but if you uncomment line 1, and remove line 2 thru 4 and it blows up -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring / Freelance EdgeTech, Inc. 678.910.8017 AIM: jmitchtx Yahoo: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Jeff Beal [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, April 01, 2005 9:01 AM Subject: Re: status messages in html:link tag On Mar 31, 2005 1:54 PM, Fumo, Vince [EMAIL PROTECTED] wrote: 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? c:set/ -- Jeff Beal Webmedx, Inc. Pittsburgh, PA USA - 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]
Re: Re: status messages in html:link tag
Ich bin bis 01.05.2005 nicht zu erreichen. In dringenden Fällen kontaktieren Sie bitte: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: Re: status messages in html:link tag
Ich bin bis 01.05.2005 nicht zu erreichen. In dringenden Fällen kontaktieren Sie bitte: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: Re: Re: status messages in html:link tag
Ich bin bis 01.05.2005 nicht zu erreichen. In dringenden Fällen kontaktieren Sie bitte: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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.Stringbean: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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: status messages in html:link tag
cool.. thanks! -Original Message- From: Bob Arnott [mailto:[EMAIL PROTECTED] 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.Stringbean: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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: status messages in html:link tag
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:[EMAIL PROTECTED] 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.Stringbean: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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]