You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve A Drake <sa...@comet.ucar.edu> on 2001/06/13 19:10:39 UTC

i18n + html:link

 Hello. I am trying to implement internationalized rollover buttons using
html:link. To do this, I'm trying to use quotes three levels deep and I
guess that's illegal in Javascript. For example, for "onmouseover", if I
try to extract the source name from the resource file, I try:


onmouseover="changeImage('<bean:message key="header.simpleQueryImageSourceR"/>')"

then I get a servlet exception:


A Servlet Exception Has Occurred

org.apache.jasper.compiler.ParseException:
/usr/apps/tomcat/jakarta-tomcat-4.0-b
1/webapps/moria/test.jsp(55,84) Attribute header.simpleQueryImageSourceR
has no value
        at
org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:565)
        at
org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:683)
        at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:826)
...


If I hardwire the source name that I'm trying to extract, it works. For
example:

onmouseover="changeImage('simpq_en_r')"


I'm using Struts 1.0-b3. Ideas are appreciated. Thanks in advance.


Re: i18n + html:link

Posted by Steve A Drake <sa...@comet.ucar.edu>.
On Wed, 13 Jun 2001, Oleg V Alexeev wrote:

> You can create javascript functions to implement logic and refer to it
> from in onmouseover event. In javascript you can insert scriptlet code
> or bean:message tags.

 Thanks Oleg and Dallas for your responses. Embedding bean:message tags in
a javascript function worked.


Re: i18n + html:link

Posted by Oleg V Alexeev <go...@penza.net>.
Hello Steve,

Wednesday, June 13, 2001, 9:10:39 PM, you wrote:

SAD>  Hello. I am trying to implement internationalized rollover buttons using
SAD> html:link. To do this, I'm trying to use quotes three levels deep and I
SAD> guess that's illegal in Javascript. For example, for "onmouseover", if I
SAD> try to extract the source name from the resource file, I try:


SAD> onmouseover="changeImage('<bean:message key="header.simpleQueryImageSourceR"/>')"

There is two strings - "changeImage('<bean:message key=" and "/>')"
Here is problem - parser treates it as two different string constants.

You can create javascript functions to implement logic and refer to it
from in onmouseover event. In javascript you can insert scriptlet code
or bean:message tags.

SAD> then I get a servlet exception:


SAD> A Servlet Exception Has Occurred

SAD> org.apache.jasper.compiler.ParseException:
SAD> /usr/apps/tomcat/jakarta-tomcat-4.0-b
SAD> 1/webapps/moria/test.jsp(55,84) Attribute header.simpleQueryImageSourceR
SAD> has no value
SAD>         at
SAD> org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:565)
SAD>         at
SAD> org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:683)
SAD>         at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:826)
SAD> ...


SAD> If I hardwire the source name that I'm trying to extract, it works. For
SAD> example:

SAD> onmouseover="changeImage('simpq_en_r')"


SAD> I'm using Struts 1.0-b3. Ideas are appreciated. Thanks in advance.



-- 
Best regards,
 Oleg                            mailto:gonza@penza.net