struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kawczynski, David" <david_kawczyn...@merck.com>
Subject RE: Making strings in ApplicationResources.properties available to Javascript
Date Mon, 15 Sep 2008 17:41:56 GMT
Devils advocate: do the ends justify the means?

Assuming the javascript you speak of exists in a js file (not a jsp
file)...
If the struts filter is mapped to '/' you can include a struts taglib on
the js file, and use ognl to look up global-properties.

I'd caution against this, as the average javascript developer will cuss
you for changing their otherwise static world.  


-----Original Message-----
From: Michael Pelz Sherman [mailto:mpelzsherman@yahoo.com] 
Sent: Monday, September 15, 2008 12:51 PM
To: user@struts.apache.org
Subject: Making strings in ApplicationResources.properties available to
Javascript

I'd like to stop putting hard-coded strings (error messages and such) in
our javascript code.

I'm considering writing a class that runs at startup & generates a
javascript file that contains all of the strings from
ApplicationResources.properties in javascript class.

Is there a better approach?

- mps
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


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


Mime
View raw message