You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pe...@bnpparibas.com on 2012/09/04 19:49:56 UTC

Tr : Refresh Message Resources

Good afternoon in my timezone.


First of all , thanks to mgainty@hotmail.com for the fast answer.
I already found why i was not able to refresh the message resources.I was 
forcing to download the struts 1.3.10 source code and make reverse 
engineering to see how struts works.And the problem was pretty obvious , 
my custom class extends from  org.apache.struts.util.MessageResources and 
this class have a set of getMessage methods and i just override one of 
them, the one that was called when th jsp was rendered for the first 
time.The other times the framework call another version of the method , so 
i just had to override that version either.


With the best regards.


Pedro Costa 
----- Forwarded by Pedro Felipe COSTA/BPSS/FR/EUROPE/GROUP on 04-09-2012 
14:37 -----



Refresh Message Resources

Pedro Felipe COSTA 
Contractor


To:
user

04-09-2012 10:26





From:
Pedro Felipe COSTA


Contractor




To:
user@struts.apache.org




Good Morning in my timezone.

I changed the struts framework(1.2.9) to load the message resources from 
the database instead from property files. 
I extended one class from the org.apache.struts.util.MessageResources 
class and another one from the 
org.apache.struts.util.MessageResourcesFactory class. I changed the 
struts-config.xml file changing the message-resources tag to use my custom 
factory.
When I deployed the war file and started tomcat, the messages were loaded 
from the database, so far so good.
The problem is that after the restart when I try to load the message again 
the struts framework does not use my class anymore. It seems that use my 
class when is rendering a jsp for the first time and after that it uses 
some kind of internal cache and did not use my MessageResources class, 
more specifically the getMessage method.
Anyone can help me?
Thanks in advance.
Best regards.



This message and any attachments (the "message") is
intended solely for the intended addressees and is confidential. 
If you receive this message in error,or are not the intended recipient(s), 
please delete it and any copies from your systems and immediately notify
the sender. Any unauthorized view, use that does not comply with its purpose, 
dissemination or disclosure, either whole or partial, is prohibited. Since the internet 
cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS 
(and its subsidiaries) shall not be liable for the message if modified, changed or falsified. 
Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 
ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 
publication, totale ou partielle, est interdite. L'Internet ne permettant pas d'assurer
l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 
(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese
ou il aurait ete modifie, deforme ou falsifie. 
N'imprimez ce message que si necessaire, pensez a l'environnement.

RE: Tr : Refresh Message Resources

Posted by Martin Gainty <mg...@hotmail.com>.
Buenos

I am glad to hear you have a solution!

Saludos Cordiales (desde EEUU)
Martín 
______________________________________________ 
Porfavor..no altere o interrumptir esta communicacion...Gracias

To: user@struts.apache.org
Subject: Tr : Refresh Message Resources
From: pedrofelipe.costa@bnpparibas.com
Date: Tue, 4 Sep 2012 18:49:56 +0100

Good afternoon in my timezone.





First of all , thanks to mgainty@hotmail.com
for the fast answer.

I already found why i was not able to
refresh the message resources.I was forcing to download the struts 1.3.10
source code and make reverse engineering to see how struts works.And the
problem was pretty obvious , my custom class extends from  org.apache.struts.util.MessageResources
and this class have a set of getMessage methods and i just override one
of them, the one that was called when th jsp was rendered for the first
time.The other times the framework call another version of the method ,
so i just had to override that version either.





With the best regards.





Pedro Costa 

----- Forwarded by Pedro
Felipe COSTA/BPSS/FR/EUROPE/GROUP on 04-09-2012 14:37 -----








Refresh Message Resources




Pedro Felipe COSTA


Contractor




To:
user



04-09-2012 10:26










From:
Pedro Felipe COSTA




Contractor






To:
user@struts.apache.org









Good Morning in my timezone.



I changed the struts framework(1.2.9) to load the message
resources from the database instead from property files. 
I extended one class from the org.apache.struts.util.MessageResources
class and another one from the org.apache.struts.util.MessageResourcesFactory
class. I changed the struts-config.xml
file changing the message-resources tag to use my custom factory.
When I deployed the war file and started tomcat, the messages
were loaded from the database, so far so good.
The problem is that after the restart when I try to load
the message again the struts framework does not use my class anymore. It
seems that use my class when is rendering a jsp for the first time and
after that it uses some kind of internal cache and did not use my MessageResources
class, more specifically the getMessage method.
Anyone can help me?
Thanks in advance.
Best regards.





This message and any attachments (the "message") is

intended solely for the intended addressees and is confidential. 

If you receive this message in error,or are not the intended recipient(s), 

please delete it and any copies from your systems and immediately notify

the sender. Any unauthorized view, use that does not comply with its purpose, 

dissemination or disclosure, either whole or partial, is prohibited. Since the internet 

cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS 

(and its subsidiaries) shall not be liable for the message if modified, changed or falsified. 

Do not print this message unless it is necessary,consider the environment.



----------------------------------------------------------------------------------------------------------------------------------



Ce message et toutes les pieces jointes (ci-apres le "message") 

sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.

Si vous recevez ce message par erreur ou s'il ne vous est pas destine,

merci de le detruire ainsi que toute copie de votre systeme et d'en avertir

immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 

ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 

publication, totale ou partielle, est interdite. L'Internet ne permettant pas d'assurer

l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 

(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese

ou il aurait ete modifie, deforme ou falsifie. 

N'imprimez ce message que si necessaire, pensez a l'environnement.