struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Martín Cuervo <jo...@martincuervo.com>
Subject Getting applicationResources.properties keys
Date Tue, 28 Dec 2004 20:30:33 GMT
Hello to all,

I've start working with jasperReports with struts, and i want to externalize
the labels to use in multilanguage environment.

I use a file applicationResources.properties (with the tag message-resources
in struts-config.xml) to the jsp labels without problems, but in my report
action i've to white java source like this:

MessageResources resources = getResources(request);
/*
 * params 4 jasperReports
 */
Map params = new HashMap(); 
params.put("L_TITLE",
resources.getMessage("label.report.xxxxxx.l_title"));
params.put("L_NAME", 	resources.getMessage("label.report.xxxxxx.l_name"));
params.put("L_SURNAME",
resources.getMessage("label.report.xxxxxx.l_surname"));
params.put("L_ADDRESS",
resources.getMessage("label.report.xxxxxx.l_address"));
...

And so on

I want to read the keys of the resources and match then with the prefix
"label.report.xxxxxx." to automate the process and don't have to do the same
thind twice (in action code & in applicationResources.properties).

Thanx for all!!

PD: I use struts 1.1

-------------------------------
Jorge Martin Cuervo
 
jorge@martincuervo.com
+34 660 026 384
-------------------------------


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


Mime
View raw message