RE: Tr : Refresh Message Resources

2012-09-04 Thread Martin Gainty

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.co...@bnpparibas.com
Date: Tue, 4 Sep 2012 18:49:56 +0100

Good afternoon in my timezone.





First of all , thanks to mgai...@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.  
  

Tr : Refresh Message Resources

2012-09-04 Thread pedrofelipe . costa
Good afternoon in my timezone.


First of all , thanks to mgai...@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.


Refresh Message Resources

2012-09-04 Thread pedrofelipe . costa
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: Cannot find message resources under key org.apache.struts.action.MESSAGE

2012-04-01 Thread Dave Newton
May need more to go on.

Dave

(pardon brevity and typos, on cell)
On Apr 1, 2012 2:11 PM, "Gopinath.M"  wrote:

> Please check struts-config.xml file.
>
>


Re: Multiple Message Resources Files

2011-12-29 Thread Maithily
Here's a simpler explanation of the scenario -

I have the following properties files in classes folder :

- file_a.properties
- file_b.properties
- file_c.properties
- file_d.properties

and the following struts config files along with the message-resources tags
pointing to properties :

- a_config.xml   -->  file_a
- b_config.xml   -->  file_a
- c_config.xml   -->  none configured, but uses labels configured in *
file_d.properties*
- d_config.xml   -->  file_d

When I access a page that invokes the action servlet in the c_config.xml,
the labels do not appear on the page.

When I change the above configuration to the following, the labels appear
on the page -

- a_config.xml   -->  none
- b_config.xml   -->  none
- c_config.xml   -->  none configured, but uses labels configured in *
file_d.properties*
- d_config.xml   -->  file_d

Could anyone explain this.

Thanks and Regards,
M.

On Thu, Dec 29, 2011 at 12:28 PM, Maithily wrote:

> Thanks for the reply JB.
>
> I forgot to mention that I am using Struts version 1.1.
>
> Thanks,
> Maithily.
>
>
> On Wed, Dec 28, 2011 at 8:39 PM, Jeffrey Black wrote:
>
>> Forgive me for not fully understanding your question.
>>
>> Perhaps this link will help:
>> http://struts.apache.org/2.x/docs/localization.html
>>
>> jb
>>
>> On Wed, Dec 28, 2011 at 12:49 AM, Maithily > >wrote:
>>
>> > Hi All,
>> >
>> > I am facing the following problem with the struts message resources
>> files -
>> >
>> > - Our application has many functional modules and each module a struts
>> > config file and message resources file.
>> > - Common message resources are bundled in a single file - say
>> > "Commonresources.properties"
>> > - Mistakenly I configured the "message-resources" in more than one
>> struts
>> > config file with -
>> > 
>> >  I found this out when debugging the display issue of some of the  error
>> > messages were not displayed.
>> > - When I removed the message-resources tag from these files, the
>> messages
>> > are displayed.
>> >
>> > Has any one faced a similar issue before?
>> >
>> > I want to understand what is caused if the same properties file is
>> referred
>> > to by 2 different struts config files for the messages to be found?
>> >
>> > Any help will be appreciated.
>> >
>> > Thanks,
>> > Maithily.
>> >
>>
>>
>>
>> --
>> Best,
>>
>> Jeffrey Black
>> 512-537-9871
>> jeffrey.bl...@yahoo.com
>> --
>> Connect with me on LinkedIn: http://www.linkedin.com/in/jeffreyblack
>> Follow me on Twitter: http://twitter.com/jeffblack360
>> Check out my blog: http://jeffblack360.wordpress.com
>>
>
>


Re: Multiple Message Resources Files

2011-12-28 Thread Maithily
Thanks for the reply JB.

I forgot to mention that I am using Struts version 1.1.

Thanks,
Maithily.

On Wed, Dec 28, 2011 at 8:39 PM, Jeffrey Black wrote:

> Forgive me for not fully understanding your question.
>
> Perhaps this link will help:
> http://struts.apache.org/2.x/docs/localization.html
>
> jb
>
> On Wed, Dec 28, 2011 at 12:49 AM, Maithily  >wrote:
>
> > Hi All,
> >
> > I am facing the following problem with the struts message resources
> files -
> >
> > - Our application has many functional modules and each module a struts
> > config file and message resources file.
> > - Common message resources are bundled in a single file - say
> > "Commonresources.properties"
> > - Mistakenly I configured the "message-resources" in more than one struts
> > config file with -
> > 
> >  I found this out when debugging the display issue of some of the  error
> > messages were not displayed.
> > - When I removed the message-resources tag from these files, the messages
> > are displayed.
> >
> > Has any one faced a similar issue before?
> >
> > I want to understand what is caused if the same properties file is
> referred
> > to by 2 different struts config files for the messages to be found?
> >
> > Any help will be appreciated.
> >
> > Thanks,
> > Maithily.
> >
>
>
>
> --
> Best,
>
> Jeffrey Black
> 512-537-9871
> jeffrey.bl...@yahoo.com
> --
> Connect with me on LinkedIn: http://www.linkedin.com/in/jeffreyblack
> Follow me on Twitter: http://twitter.com/jeffblack360
> Check out my blog: http://jeffblack360.wordpress.com
>


Re: Multiple Message Resources Files

2011-12-28 Thread Jeffrey Black
Forgive me for not fully understanding your question.

Perhaps this link will help:
http://struts.apache.org/2.x/docs/localization.html

jb

On Wed, Dec 28, 2011 at 12:49 AM, Maithily wrote:

> Hi All,
>
> I am facing the following problem with the struts message resources files -
>
> - Our application has many functional modules and each module a struts
> config file and message resources file.
> - Common message resources are bundled in a single file - say
> "Commonresources.properties"
> - Mistakenly I configured the "message-resources" in more than one struts
> config file with -
> 
>  I found this out when debugging the display issue of some of the  error
> messages were not displayed.
> - When I removed the message-resources tag from these files, the messages
> are displayed.
>
> Has any one faced a similar issue before?
>
> I want to understand what is caused if the same properties file is referred
> to by 2 different struts config files for the messages to be found?
>
> Any help will be appreciated.
>
> Thanks,
> Maithily.
>



-- 
Best,

Jeffrey Black
512-537-9871
jeffrey.bl...@yahoo.com
--
Connect with me on LinkedIn: http://www.linkedin.com/in/jeffreyblack
Follow me on Twitter: http://twitter.com/jeffblack360
Check out my blog: http://jeffblack360.wordpress.com


Multiple Message Resources Files

2011-12-27 Thread Maithily
Hi All,

I am facing the following problem with the struts message resources files -

- Our application has many functional modules and each module a struts
config file and message resources file.
- Common message resources are bundled in a single file - say
"Commonresources.properties"
- Mistakenly I configured the "message-resources" in more than one struts
config file with -
 
  I found this out when debugging the display issue of some of the  error
messages were not displayed.
- When I removed the message-resources tag from these files, the messages
are displayed.

Has any one faced a similar issue before?

I want to understand what is caused if the same properties file is referred
to by 2 different struts config files for the messages to be found?

Any help will be appreciated.

Thanks,
Maithily.


Message resources -- 2 suggestions and 1 question

2010-09-17 Thread java . rgm
On this page:
http://struts.apache.org/2.2.1/docs/message-resource-files.html

Suggestion -- discuss (or at least link to) PropertyResourceBundle 
MessageFormat patterns
This page should include an example to the effect of:
numUsers = {0,choice,0#No Users|1#1 User|1<{0} Users}

Suggestion -- Expand discussion of how %{personBean.firstName}  is interpreted. 
 Does xwork2.TextProvider handle this?  What other sorts of expression-language 
constructs are possible in resources?

Question -- Is there a way to "include" another resource within a different 
one?  For example:

button.new = New
button.new.user = %{ "button.new" } User


Thank you,
-rgm

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



RE: Loading different Message Resources for user and Admin in Struts

2010-04-23 Thread Kawczynski, David
Same name bundle, same name message key, different messages...
Sounds like the wrong group list.  Try a general java list.  
Or a technical design list.
I'd say use different named bundles, the same message key, & different
messages?



> -Original Message-
> From: Zaheer Mohammad [mailto:zaheer.cse4...@gmail.com] 
> Sent: Friday, April 23, 2010 8:54 AM
> To: user@struts.apache.org
> Subject: Loading different Message Resources for user and 
> Admin in Struts
> 
> Hi Friends,
>  My Requirement is to Load Different Message resource
> bundles of same name and same tags  with different messages in them
>  differently for Administrator and userin Struts Application 
> By checking
> Login User.can any One help me.
> 
> 
> Thanks In Advance.
> Zaheer Mohammad
> 
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 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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Loading different Message Resources for user and Admin in Struts

2010-04-23 Thread Zaheer Mohammad
Hi Friends,
 My Requirement is to Load Different Message resource
bundles of same name and same tags  with different messages in them
 differently for Administrator and userin Struts Application By checking
Login User.can any One help me.


Thanks In Advance.
Zaheer Mohammad


RE: [S1] message-resources

2009-01-13 Thread Evert Lammerts
Hi Lukasz,

Thanks for your answer. They get copied to WEB-INF/classes/content at 
compile-time, and looking in the container I see they're there.

So that's not the problem... And I still haven't figured it out :-(

Evert

-Original Message-
From: Lukasz Lenart [mailto:lukasz.len...@googlemail.com] 
Sent: dinsdag 13 januari 2009 14:59
To: Struts Users Mailing List
Subject: Re: [S1] message-resources

2009/1/13 Evert Lammerts :
> In the WEB-INF/src/content folder I have two files - a Messages.properties 
> and Messages_en.properties, both containing a line looking like this:

Put it to WEB-INF/classes/content


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: [S1] message-resources

2009-01-13 Thread Lukasz Lenart
2009/1/13 Evert Lammerts :
> In the WEB-INF/src/content folder I have two files - a Messages.properties 
> and Messages_en.properties, both containing a line looking like this:

Put it to WEB-INF/classes/content


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



[S1] message-resources

2009-01-13 Thread Evert Lammerts
Hi all,

Sorry for the repetition, but I can't seem to figure this out in spite of all 
those resources you can find online.

Using struts 1.3.8 (in Liferay 5.1.2 portal on Tomcat 6.0, through the apache 
bridge) I'm having trouble accessing message resources.

In a portlet I've a struts-config that loads the resource file like this:



In the WEB-INF/src/content folder I have two files - a Messages.properties and 
Messages_en.properties, both containing a line looking like this:

error.name.required=Please fill in your name

My JSP has a line saying: 

The exception that is generated is:

javax.servlet.jsp.JspException: Missing message for key "error.name.required"

Now I understand this is might be a classpath problem. However, I don't know 
how am I expected to tell Struts where it can find these resources?

Kind regards,
Evert


Re: Unable to get messages from Message resources file for keys

2008-10-23 Thread Rajiv Singla

Yes we have struts2-spring-plugin-2.0.6.jar in lib folder.
I have attached my struts.properties file


My web.xml has following listeners


org.springframework.web.context.request.RequestContextListener




org.springframework.web.context.ContextLoaderListener




org.apache.myfaces.webapp.StartupServletContextListener



Regards,
Rajiv






Mead Lai wrote:
> 
> Wrong configuration!
> Do U add struts-spring-plugin.jar to the lib folder?
> Any config in the struts.properties and web.xml to correct load spring
> context with context-listener?
> 
> On Thu, Oct 23, 2008 at 3:20 PM, Rajiv Singla
> <[EMAIL PROTECTED]>wrote:
> 
>>
>> Configuration: Websphere 6.1.0.19 App Server, Oracle DB 10g, Struts
>> 2.0.6,
>> Spring2.0.3 and Hibernate 3.0
>>
>>
>> We have a web app having 3 layers - Action classes, Service or Business
>> Objects and DAOs.
>> BOs and DAOs are accessed thru interfaces.
>> We use spring to inject dependency.
>>
>> We have defined scope="session" for beans corresponding to actions.
>> For BOs and DAOs , no scope is defined. We are using applicationContext
>> xml
>> files to define beans.
>>
>> Labels and buttons names are picked up from MessageResources.properties
>> file.
>> But on some pages these values are not picked up and labels go missing.
>>
>> I am new to both Spring and Struts 2 and I am unable to figure that why
>> this
>> is happening.
>> Message resources are loaded in context and it should be available to
>> all.
>>
>> Please help me resolve this issue.
>>
>> Thanks in advance,
>>
>> Rajiv
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Unable-to-get-messages-from-Message-resources-file-for-keys-tp20125626p20125626.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> BestRegards,
> Mead
> http://yayisoft.com
> 
> Rita Rudner  - "I wonder if other dogs think poodles are members of a
> weird
> religious cult."
> 
> 
http://www.nabble.com/file/p20126721/struts.properties struts.properties 
http://www.nabble.com/file/p20126721/struts.properties struts.properties 
-- 
View this message in context: 
http://www.nabble.com/Unable-to-get-messages-from-Message-resources-file-for-keys-tp20125626p20126721.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unable to get messages from Message resources file for keys

2008-10-23 Thread Mead Lai
Wrong configuration!
Do U add struts-spring-plugin.jar to the lib folder?
Any config in the struts.properties and web.xml to correct load spring
context with context-listener?

On Thu, Oct 23, 2008 at 3:20 PM, Rajiv Singla <[EMAIL PROTECTED]>wrote:

>
> Configuration: Websphere 6.1.0.19 App Server, Oracle DB 10g, Struts 2.0.6,
> Spring2.0.3 and Hibernate 3.0
>
>
> We have a web app having 3 layers - Action classes, Service or Business
> Objects and DAOs.
> BOs and DAOs are accessed thru interfaces.
> We use spring to inject dependency.
>
> We have defined scope="session" for beans corresponding to actions.
> For BOs and DAOs , no scope is defined. We are using applicationContext xml
> files to define beans.
>
> Labels and buttons names are picked up from MessageResources.properties
> file.
> But on some pages these values are not picked up and labels go missing.
>
> I am new to both Spring and Struts 2 and I am unable to figure that why
> this
> is happening.
> Message resources are loaded in context and it should be available to all.
>
> Please help me resolve this issue.
>
> Thanks in advance,
>
> Rajiv
>
> --
> View this message in context:
> http://www.nabble.com/Unable-to-get-messages-from-Message-resources-file-for-keys-tp20125626p20125626.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
BestRegards,
Mead
http://yayisoft.com

Rita Rudner  - "I wonder if other dogs think poodles are members of a weird
religious cult."


Unable to get messages from Message resources file for keys

2008-10-23 Thread Rajiv Singla

Configuration: Websphere 6.1.0.19 App Server, Oracle DB 10g, Struts 2.0.6,
Spring2.0.3 and Hibernate 3.0 


We have a web app having 3 layers - Action classes, Service or Business
Objects and DAOs. 
BOs and DAOs are accessed thru interfaces. 
We use spring to inject dependency. 

We have defined scope="session" for beans corresponding to actions. 
For BOs and DAOs , no scope is defined. We are using applicationContext xml
files to define beans. 

Labels and buttons names are picked up from MessageResources.properties
file. 
But on some pages these values are not picked up and labels go missing. 

I am new to both Spring and Struts 2 and I am unable to figure that why this
is happening. 
Message resources are loaded in context and it should be available to all. 

Please help me resolve this issue. 

Thanks in advance, 

Rajiv

-- 
View this message in context: 
http://www.nabble.com/Unable-to-get-messages-from-Message-resources-file-for-keys-tp20125626p20125626.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Loading message resources properties from a database

2008-09-04 Thread Laurie Harper

laredotornado wrote:

Hi,

I'm using Struts 1.  We want to load our message resources properties,
currently defined in our struts-config.xml file:



from a database.  Now of course, they are in a file called
"MessageResources.properties".  What is the proper way to do this?


You need to add a factory= attribute and point it to a custom 
implementation of MessageResourcesFactory [1] that can load resource 
bundles from your database. You can probably find example 
implementations in the list archives if you need some further pointers.


L.

[1] 
http://struts.apache.org/1.3.9/apidocs/org/apache/struts/util/MessageResourcesFactory.html



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Loading message resources properties from a database

2008-09-03 Thread laredotornado

Hi,

I'm using Struts 1.  We want to load our message resources properties,
currently defined in our struts-config.xml file:



from a database.  Now of course, they are in a file called
"MessageResources.properties".  What is the proper way to do this?

Thanks, - Dave
-- 
View this message in context: 
http://www.nabble.com/Loading-message-resources-properties-from-a-database-tp19290916p19290916.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources ???key??? displaying

2008-07-14 Thread danipruebas

Hi,

That was the correct path, I didn´t know about it.
Thank you for your answers, guys. ;-)


- Original Message - 
From: "Lukasz Lenart" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Monday, July 14, 2008 8:22 PM
Subject: Re: message resources ???key??? displaying



The ApplicationResources.properties file  is under:
proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties


Move to the /WEB-INF/classes


Regards
--
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Email procesado por MailFoundry




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources ???key??? displaying

2008-07-14 Thread Lukasz Lenart
> The ApplicationResources.properties file  is under:
> proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties

Move to the /WEB-INF/classes


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources ???key??? displaying

2008-07-14 Thread Dante A. Castiglione Maldonado
I got the same problem a few moments ago

I put the ApplicationResources.properties file under WEB-INF/classes
and it worked ok


2008/7/14  <[EMAIL PROTECTED]>:
> It is configured as:
>
> struts-config.xml
> 
>
> In web.xml is not defined.
>
> The ApplicationResources.properties file  is under:
> proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties
>
> And the jsp code:
>
> 
> 
> 
> 
> 
>
> Is something wrong about the path/classpath? Do I  need to add a key to
> ??
>
> Regards,
>
>
> - Original Message - From: "Lukasz Lenart"
> <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Monday, July 14, 2008 6:32 PM
> Subject: Re: message resources ???key??? displaying
>
>
>> Hi,
>>
>> How did you configure the messages in struts-config? It should be
>> something like this:
>>
>> 
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> Email procesado por MailFoundry
>>
>
>
> -
> 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: message resources ???key??? displaying

2008-07-14 Thread danipruebas

It is configured as:

struts-config.xml


In web.xml is not defined.

The ApplicationResources.properties file  is under:
proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties

And the jsp code:







Is something wrong about the path/classpath? Do I  need to add a key to 
??


Regards,


- Original Message - 
From: "Lukasz Lenart" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Monday, July 14, 2008 6:32 PM
Subject: Re: message resources ???key??? displaying



Hi,

How did you configure the messages in struts-config? It should be
something like this:




Regards
--
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Email procesado por MailFoundry




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources ???key??? displaying

2008-07-14 Thread Lukasz Lenart
Hi,

How did you configure the messages in struts-config? It should be
something like this:




Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



message resources ???key??? displaying

2008-07-14 Thread danipruebas
Hi, I´m developing a project with Struts 1.2. When  trying to display 
 in a jsp page, the errors saved in SaveMessages are displayed, 
but not correctly, for example:

in showerrors.jsp:
???es.error.wrong.password??? 

instead of:
Your password is wrong.

The ApplicationResources.properties file is properly mapped with its keys. 
error.wrong.password = Your password is wrong

Figure out that a "es." is displayed while no Locale configuration has been 
setup.

What should I check? Any ideas will be welcomed.

Thanks,


Message resources - Application Resource - Polish

2008-01-10 Thread Raghuveer
Hello,

 

Since I have only to languages ,I have provided a button in screen and
passing url parameter "english" and "polish".

 

In Action file taking this language and forming locale object and setting to
ACTION method "setLocale"

 

Wprowadź - Enter

 

Above polish word is not coming exactly as label in JSP page when page is
rendered.

Actual polish word is modified -  

 

 

Could any one suggest any solution to resolve the i18N for messages.

 

--

 

 

if(strLanguage!=null && strLanguage.equalsIgnoreCase("english")){

strLanguage="en";

strCountry="US";

}else if(strLanguage!=null && strLanguage.equalsIgnoreCase("polish")){

strLanguage="pl";

strCountry="PL";

}else{

strLanguage="pl";

strCountry="PL";

}



AW: Re: Re: Re: Message resources configuration

2008-01-02 Thread Sebastian Göttschkes
Hi again,

I wrote:
>> Hi,
>> 
>> Laurie Harper wrote:
>> >> Sebastian Göttschkes wrote:
>> >> >> Laurie Harper wrote:
>> >> >> Sebastian Göttschkes wrote:
>> >> >>> [...]
>> >> >>>
>> >> >>> I defined the message resources in the struts-config.xml:
>> >> >>> 
>> >> >>> > >> >>> parameter="com.equitystory.pms.resources.ApplicationResources" />
>> >> >>>
>> >> >>> [...]
>> >> > 
>> >> > The strange thing is I didn't change anything except for the two empty 
>> >> > files I created. So I can say that the problem isn't hard-coded text in 
>> >> > the application or messages missing in one or the other resource. Maybe 
>> >> > I got something wrong with the configuration? Is there another file 
>> >> > where I have to configurate something related to the message resources 
>> >> > except for the struts-config.xml I mentioned above?
>> >> 
>> >> 
>> >> Nope, that one configuration point is all there is. Check the properties 
>> >> files are actually being deployed to the correct place, that there 
>> >> aren't stale copies elsewhere on the classpath or in any JAR files 
>> >> you've packaged, etc.
>> 
>> I checked everything you mentioned and there is no improvement.
>> 
>> >> 
>> >> Failing that, you might try increasing Struts' logging level to DEBUG 
>> >> and see if there are any hints as to what's going wrong in the logs.
>> 
>> After playing around a bit with my firefox and chaging the locale settings 
>> via locale switcher to en-US it's working. I don't know why, but now it's 
>> also working in my english browser.
>> I'm a bit confused why it's working now and why it didn't worked before. 
>> Maybe it's because I deployed the whole app again after removing the whole 
>> context and building it again.
>> I'm going to test the app and if it's working now, I'm fine with that. If 
>> it's not working properly, I'll get back to you.

Ok, after testing the app I now know more about the behavoirs of the app.

When the first browser launching the app after restarting the server is german, 
only german works fine. When afterwards connecting with an english browser, the 
errors I expected at first are all there.
But when I connect with the english browser first after restarting the server, 
everything is just fine. I can change the browsers and both english and german 
are working. So what is happening? 

I'll have a deeper look at the debug log files from log4j tomorrow. Maybe 
anyone knows something about this problem and can help me. I don't really know 
what is happening here and what I'm trying to find in the logs ;-)

Thanks and Regards,
Sebastian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Re: Re: Message resources configuration

2008-01-02 Thread Sebastian Göttschkes
Hi,

Laurie Harper wrote:
>> Sebastian Göttschkes wrote:
>> >> Laurie Harper wrote:
>> >> Sebastian Göttschkes wrote:
>> >>> [...]
>> >>>
>> >>> I defined the message resources in the struts-config.xml:
>> >>> 
>> >>> > >>> parameter="com.equitystory.pms.resources.ApplicationResources" />
>> >>>
>> >>> [...]
>> > 
>> > The strange thing is I didn't change anything except for the two empty 
>> > files I created. So I can say that the problem isn't hard-coded text in 
>> > the application or messages missing in one or the other resource. Maybe I 
>> > got something wrong with the configuration? Is there another file where I 
>> > have to configurate something related to the message resources except for 
>> > the struts-config.xml I mentioned above?
>> 
>> 
>> Nope, that one configuration point is all there is. Check the properties 
>> files are actually being deployed to the correct place, that there 
>> aren't stale copies elsewhere on the classpath or in any JAR files 
>> you've packaged, etc.

I checked everything you mentioned and there is no improvement.

>> 
>> Failing that, you might try increasing Struts' logging level to DEBUG 
>> and see if there are any hints as to what's going wrong in the logs.

After playing around a bit with my firefox and chaging the locale settings via 
locale switcher to en-US it's working. I don't know why, but now it's also 
working in my english browser.
I'm a bit confused why it's working now and why it didn't worked before. Maybe 
it's because I deployed the whole app again after removing the whole context 
and building it again.
I'm going to test the app and if it's working now, I'm fine with that. If it's 
not working properly, I'll get back to you.

Thanks for your help,
Sebastian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AW: Re: Message resources configuration

2007-12-28 Thread Laurie Harper

Sebastian Göttschkes wrote:

Laurie Harper wrote:
Sebastian Göttschkes wrote:

[...]

I defined the message resources in the struts-config.xml:



[...]


The strange thing is I didn't change anything except for the two empty files I 
created. So I can say that the problem isn't hard-coded text in the application 
or messages missing in one or the other resource. Maybe I got something wrong 
with the configuration? Is there another file where I have to configurate 
something related to the message resources except for the struts-config.xml I 
mentioned above?



Nope, that one configuration point is all there is. Check the properties 
files are actually being deployed to the correct place, that there 
aren't stale copies elsewhere on the classpath or in any JAR files 
you've packaged, etc.


Failing that, you might try increasing Struts' logging level to DEBUG 
and see if there are any hints as to what's going wrong in the logs.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: Re: Message resources configuration

2007-12-28 Thread Sebastian Göttschkes
Hi,

>Laurie Harper wrote:
>
>Sebastian Göttschkes wrote:
>> Hi,
>> 
>> I'm experiencing strange behaviours with the message resources and I'm not 
>> sure about where to find the problem.
>> 
>> I defined the message resources in the struts-config.xml:
>> 
>> > parameter="com.equitystory.pms.resources.ApplicationResources" />
>> 
>> In the folder named in the xml 
>> (Resources/src/com/equitystory/pms/resources/), I created the following 
>> files:
>> ApplicationResources.properties
>> ApplicationResources_de.properties
>> 
>> When accessing the application with a browser "speaking" "de", I see the 
>> correct messages, but sometimes log4j is telling me that 
>> ApplicationResources_de_DE.properties is missing. I created this file and 
>> left it empty.
>> When accessing the application with an browser "pseaking" "en", the 
>> application is mixed up with german and english messages (as defined in the 
>> ApplicationResources). I created ApplicationResources_en.properties and left 
>> it empty, and now everything works fine. 
>> 
>> The problem I now got is what happens if someone with a browser "speaking" 
>> another language is accessing the application? It would be great if there 
>> would be an easier solution with just the two files I named above and struts 
>> using the default file if there is no language-specific file (e.g. 
>> "ApplicationResources_de.properties" for every browser speaking "de" and 
>> "ApplicationResources.properties" for all other languages).
>
>Everything *should* work just as you describe... You shouldn't need the 
>empty files, and resource lookup should automatically walk 'up' the 
>hierarchy from ApplicationResources_de_DE.properties to 
>ApplicationResources_de.properties to ApplicationResources.properties, 
>skipping files that don't exist and using the messages defined in the 
>most specific file that *does* exist.

>I would suggest deleting your empty files and then trying to determine 
>why you get a mixture of English and German when you're expecting to get 
>everything in one language or the other. It sounds like a problem with 
>how you have internationalized and/or localized the application -- e.g. 
>maybe you have some of your messages hard-coded still, or messages 
>missing from one of the properties files.

The strange thing is I didn't change anything except for the two empty files I 
created. So I can say that the problem isn't hard-coded text in the application 
or messages missing in one or the other resource. Maybe I got something wrong 
with the configuration? Is there another file where I have to configurate 
something related to the message resources except for the struts-config.xml I 
mentioned above?

Thanks,
Sebastian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Message resources configuration

2007-12-27 Thread Laurie Harper

Sebastian Göttschkes wrote:

Hi,

I'm experiencing strange behaviours with the message resources and I'm not sure 
about where to find the problem.

I defined the message resources in the struts-config.xml:



In the folder named in the xml (Resources/src/com/equitystory/pms/resources/), 
I created the following files:
ApplicationResources.properties
ApplicationResources_de.properties

When accessing the application with a browser "speaking" "de", I see the 
correct messages, but sometimes log4j is telling me that ApplicationResources_de_DE.properties is 
missing. I created this file and left it empty.
When accessing the application with an browser "pseaking" "en", the application is mixed up with german and english messages (as defined in the ApplicationResources). I created ApplicationResources_en.properties and left it empty, and now everything works fine. 


The problem I now got is what happens if someone with a browser "speaking" another language is accessing the 
application? It would be great if there would be an easier solution with just the two files I named above and struts 
using the default file if there is no language-specific file (e.g. "ApplicationResources_de.properties" for 
every browser speaking "de" and "ApplicationResources.properties" for all other languages).


Everything *should* work just as you describe... You shouldn't need the 
empty files, and resource lookup should automatically walk 'up' the 
hierarchy from ApplicationResources_de_DE.properties to 
ApplicationResources_de.properties to ApplicationResources.properties, 
skipping files that don't exist and using the messages defined in the 
most specific file that *does* exist.


I would suggest deleting your empty files and then trying to determine 
why you get a mixture of English and German when you're expecting to get 
everything in one language or the other. It sounds like a problem with 
how you have internationalized and/or localized the application -- e.g. 
maybe you have some of your messages hard-coded still, or messages 
missing from one of the properties files.


HTH,

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Message resources configuration

2007-12-27 Thread Sebastian Göttschkes
Hi,

I'm experiencing strange behaviours with the message resources and I'm not sure 
about where to find the problem.

I defined the message resources in the struts-config.xml:



In the folder named in the xml (Resources/src/com/equitystory/pms/resources/), 
I created the following files:
ApplicationResources.properties
ApplicationResources_de.properties

When accessing the application with a browser "speaking" "de", I see the 
correct messages, but sometimes log4j is telling me that 
ApplicationResources_de_DE.properties is missing. I created this file and left 
it empty.
When accessing the application with an browser "pseaking" "en", the application 
is mixed up with german and english messages (as defined in the 
ApplicationResources). I created ApplicationResources_en.properties and left it 
empty, and now everything works fine. 

The problem I now got is what happens if someone with a browser "speaking" 
another language is accessing the application? It would be great if there would 
be an easier solution with just the two files I named above and struts using 
the default file if there is no language-specific file (e.g. 
"ApplicationResources_de.properties" for every browser speaking "de" and 
"ApplicationResources.properties" for all other languages).

Thanks in advance,
Sebastian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Cannot find message resources under key org.apache.struts.action.MESSAGE

2007-11-26 Thread forumuser

I tried to deploy struts application on RAD Websphere App Server 6. 
it is throwing following exception 

javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE 

and on the browser it says internal server error 500


please help as what to do to run it success fully.
 
-- 
View this message in context: 
http://www.nabble.com/Cannot-find-message-resources-under-key-org.apache.struts.action.MESSAGE-tf4874805.html#a13948506
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources in struts.xml

2007-08-23 Thread Pavel Sapozhnikov
Also in jsp I have  I also see a line in
tomcat where its loading MessageResources.properties file now if I remove
name tag from s:bean it compains cuz name is required but at the same time I
don't know what should go in name attribute.

On 8/23/07, Pavel Sapozhnikov <[EMAIL PROTECTED]> wrote:
>
> Oh great. Thank you very much. Do I need to include any jars or what not
>
> On 8/23/07, Jiang, Jane (NIH/NCI) [C] < [EMAIL PROTECTED]> wrote:
> >
> > I think it is the value of struts.custom.i18n.resources in
> > struts.properties. You can also put it in struts.xml as
> >  > />
> >
> > -Original Message-
> > From: Pavel Sapozhnikov [mailto: [EMAIL PROTECTED]
> > Sent: Thursday, August 23, 2007 2:14 PM
> > To: Struts Users Mailing List
> > Subject: message resources in struts.xml
> >
> > Hi I have a question in Struts 1 in struts-config.xml I have:
> >
> > 
> >
> > What would the equivalent be in Struts2
> >
> > Thank you
> >
> > --
> > Pavel Sapozhnikov
> > xFact, Inc
> > [EMAIL PROTECTED]
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Pavel Sapozhnikov
> xFact, Inc
> [EMAIL PROTECTED]
>



-- 
Pavel Sapozhnikov
xFact, Inc
[EMAIL PROTECTED]


Re: message resources in struts.xml

2007-08-23 Thread Pavel Sapozhnikov
Oh great. Thank you very much. Do I need to include any jars or what not

On 8/23/07, Jiang, Jane (NIH/NCI) [C] <[EMAIL PROTECTED]> wrote:
>
> I think it is the value of struts.custom.i18n.resources in
> struts.properties. You can also put it in struts.xml as
>  />
>
> -Original Message-
> From: Pavel Sapozhnikov [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 23, 2007 2:14 PM
> To: Struts Users Mailing List
> Subject: message resources in struts.xml
>
> Hi I have a question in Struts 1 in struts-config.xml I have:
>
> 
>
> What would the equivalent be in Struts2
>
> Thank you
>
> --
> Pavel Sapozhnikov
> xFact, Inc
> [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Pavel Sapozhnikov
xFact, Inc
[EMAIL PROTECTED]


RE: message resources in struts.xml

2007-08-23 Thread Jiang, Jane (NIH/NCI) [C]
I think it is the value of struts.custom.i18n.resources in
struts.properties. You can also put it in struts.xml as


-Original Message-
From: Pavel Sapozhnikov [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 2:14 PM
To: Struts Users Mailing List
Subject: message resources in struts.xml

Hi I have a question in Struts 1 in struts-config.xml I have:



What would the equivalent be in Struts2

Thank you

-- 
Pavel Sapozhnikov
xFact, Inc
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



message resources in struts.xml

2007-08-23 Thread Pavel Sapozhnikov
Hi I have a question in Struts 1 in struts-config.xml I have:



What would the equivalent be in Struts2

Thank you

-- 
Pavel Sapozhnikov
xFact, Inc
[EMAIL PROTECTED]


Message resources

2007-08-13 Thread stanlick
Where are the "stock" validation messages located?  Are we still required to
be copy them into our application message file?

-- 
Scott
[EMAIL PROTECTED]


RE: Accessing message resources

2007-04-05 Thread Dave Newton
--- David Harland <[EMAIL PROTECTED]> wrote:
> In struts 1 you could access the resource bundles
> using Resources.getMessage from any class. How do
you
> do the same in struts 2 using getText.

http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html#getTexts(java.lang.String)

That returns a regular ResourceBundle with which you
can play whatever games you want.

d.



 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Accessing message resources

2007-04-05 Thread David Harland
 
In struts 1 you could access the resource bundles using
Resources.getMessage from any class. How do you do the same in struts 2
using getText.


-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: 05 April 2007 12:45
To: Struts Users Mailing List
Subject: Re: Accessing message resources

--- David Harland <[EMAIL PROTECTED]> wrote:
> How do you use ognl to access resources outside of a class that 
> extends ActionSupport. eg the struts 2 equivalent to 
> Resources.getMessage  but
> getText() instead

I'm not aware that you'd normally use OGNL for that; the 
and  tags are what (I
think?) would be used on a JSP page.

The last I heard there were some issues with  for 2.0.6;
searching JIRA may shed some light on current status.

d.



 


Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo!
Games.
http://videogames.yahoo.com/platform?platform=120121

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


- --
ML {UFI}

__
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

__

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Accessing message resources

2007-04-05 Thread David Harland
Hi,

How do you use ognl to access resources outside of a class that extends 
ActionSupport. eg the struts 2 equivalent to Resources.getMessage  but

getText() instead

Thanks

Dave.





 

Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Accessing message resources

2007-04-05 Thread Dave Newton
--- David Harland <[EMAIL PROTECTED]> wrote:
> How do you use ognl to access resources outside of a
> class that extends ActionSupport. eg the struts 2
> equivalent to Resources.getMessage  but
> getText() instead

I'm not aware that you'd normally use OGNL for that;
the  and  tags are what (I
think?) would be used on a JSP page.

The last I heard there were some issues with
 for 2.0.6; searching JIRA may shed some
light on current status.

d.



 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-12-29 Thread Laurie Harper

Kranti wrote:

hi,

i have a problem related to message resources
during the login time i am doing this
session.setAttribute(Globals.LOCALE_KEY, locale);
where locale is created by the user specific language settings there in DB.

in jsp:



using this and in struts config file


and inthe same directory i have other ApplicationResources files also for
different languages.

But its not picking the properties from diff files when we change the
language settings..eventhough i updated the session attribute for 
LOCALE_KEY


What properties files do you have? Where are they deployed withing the 
WAR file? and what value are you setting for Globals.LOCALE_KEY? Most 
likely there's a mis-match between the locale you're setting and the 
naming of the properties files so that Struts isn't finding the file you 
want it to.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



message resources

2006-12-20 Thread Kranti

hi,

i have a problem related to message resources
during the login time i am doing this
session.setAttribute(Globals.LOCALE_KEY, locale);
where locale is created by the user specific language settings there in DB.

in jsp:



using this and in struts config file


and inthe same directory i have other ApplicationResources files also for
different languages.

But its not picking the properties from diff files when we change the
language settings..eventhough i updated the session attribute for LOCALE_KEY

please suggest


Re: [s2] Message resources from database

2006-11-25 Thread Ted Husted

On 11/25/06, Ted Husted <[EMAIL PROTECTED]> wrote:

Essentially, you can implement the Java ResourceBundle interface


/s/implement the Java ResourceBundle interface/extend the Java
ResourceBundle class

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] Message resources from database

2006-11-25 Thread Ted Husted

It's actually fairly simple to do. There's a detailed example in the
WebWork in Action book (see page 375).

Struts 2 (and WW2) search the class heirarchy for message resources,
looking first for classes that

Essentially, you can implement the Java ResourceBundle interface and
have it lookup the messages from whereever. You can then plug the
class in using a Struts 2 property

struts.custom.i18n = MyResourceBundle

or by calling

LocalizedTextUtil.addDefaultResourceBundle("MyResourceBundle")

from a ServletContextListener at startup.

The ResourceBundle class is then discovered and utilized just like a
.properties file.

-Ted.

On 11/17/06, Nate Drake <[EMAIL PROTECTED]> wrote:

Hi,

We're in the process of migrating a Struts1 app to Struts2.  In Struts1 we
created a subclass of PropertyMessageResources to get our messages from the
database instead of properties files.  I can't seem to find how we'd go about
doing this in Struts2.  Do I just subclass
com.opensymphony.xwork.util.LocalizedTextUtil and configure the
framework to use it?

Thanks!

Nate


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2] Message resources from database

2006-11-17 Thread Nate Drake
Hi,

We're in the process of migrating a Struts1 app to Struts2.  In Struts1 we
created a subclass of PropertyMessageResources to get our messages from the
database instead of properties files.  I can't seem to find how we'd go about
doing this in Struts2.  Do I just subclass
com.opensymphony.xwork.util.LocalizedTextUtil and configure the 
framework to use it?

Thanks!

Nate


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reload Message resources i.e Resource Bundle

2006-08-18 Thread Yahzz Yan
this article might help you out
http://www.javaworld.com/javaworld/jw-06-2006/jw-0612-dynamic.html
  
Monkeyden <[EMAIL PROTECTED]> wrote:
  I usually just touch the web.xml, to redeploy the app, but this isn't always
feasible in production.

On 8/17/06, Harsh Gupta wrote:
>
> How to Reload Message resources i.e Resource Bundles in struts 1.1???
>
>
>
> ___
> Harsh Gupta
> Software Engineer
> MPS Technologies (A Macmillan company)
>
> Email: h [EMAIL PROTECTED]
> Web: www.mpstechnologies.com
>
> Tel: + 91 124 2704 111 (Direct Line)
>
> + 91 124 2704 100 (Board)
> Fax:+ 91 124 288 1052
>
> Mail: MPS Technologies, 3A, 4th & 5th Floors, DLF Corporate Park, Gurgaon
> 122 002, Haryana, India
>
>
>
>
>



-
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

message-resources with keys don't work

2006-08-18 Thread Matthew T Wall

I need assistance with a very unique problem.

I am working on a struts based project that uses multiple property files.
We are running it off of a servlet defined with multiple strut configs.
The project is run with IBM Websphere 5.1, Servlet 2.3, JSP 1.2, and Struts
1.1 beta.  The problem is that using a message-resources defined with a key
does not work.  I have performed many experiments to try and track the
problem down.  Here's what I've discovered:

<> Using a message-resource DOES work if a key is not defined.

<> When a key is defined, having something like  will produce an exception like "Could not find bundle under
key foo"

<> However, having a message-resource defined with a key of
"org.apache.struts.action.MESSAGE" DOES work, and works whether you access
it by 
or 

<> This problem occurs anywhere in the servlet, regardless of the struts
config that I use.

<> Upgrading struts to 1.2.7 did not fix the problem.

This problem seems to be with the servlet.  It has been in use for a while
now, but it seems that this is a pre-existing problem that wasn't detected
because nobody ever tried using multiple property files.  Here's the
web.xml that the servlet uses:


http://java.sun.com/dtd/web-app_2_3.dtd";>

  FixToolsWeb
  
NavigationFile
com/ibm/sdwb/cpsweb/resources/Navigation.xml
Navigation File
  
  
NavigationFile/ve
com/ibm/sdwb/cpsweb/ve/Navigation.xml
Navigation File
  
  
NavigationFile/fix
com/ibm/sdwb/cpsweb/fix/Navigation.xml
Navigation File
  
  
NavigationFile/ec
com/ibm/sdwb/cpsweb/ec/Navigation.xml
Navigation File
  
  
NavigationFile/cr
com/ibm/sdwb/cpsweb/cr/Navigation.xml
Navigation File
  
  
com.ibm.sdwb.cpsweb.FixWebListener
  
  
action
org.apache.struts.action.ActionServlet

  config/common
  common/struts-common-config.xml


  config/fix
  fix/struts-fix-config.xml


  config/ec
  ec/struts-ec-config.xml


  config/cr
  cr/struts-cr-config.xml


  config/ve
  ve/struts-ve-config.xml


  config/cpse
  cpse/struts-cpse-config.xml


  config/cpseadmin
  cpseadmin/struts-cpseadmin-config.xml


  debug
  0


  detail
  0


  validate
  true

2
  
  
FixInitServlet
FixInitServlet
com.ibm.sdwb.cpsweb.FixInitServlet
1
  
  
StorageServlet
StorageServlet
com.ibm.bldcommon.storage.http.StorageServlet
  
  
action
*.wss
  
  
StorageServlet
/fix/StorageServlet
  
  
index.html
  
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  
  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  
  
/WEB-INF/struts-html-el.tld
/WEB-INF/struts-html-el.tld
  
  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  
  
/WEB-INF/struts-nested.tld
/WEB-INF/struts-nested.tld
  
  
/WEB-INF/struts-template.tld
/WEB-INF/struts-template.tld
  
  
/WEB-INF/struts-tiles.tld
/WEB-INF/struts-tiles.tld
  
  
http://jakarta.apache.org/taglibs/application-1.0
/WEB-INF/lib/taglibs-application.jar
  
  
http://jakarta.apache.org/taglibs/page-1.0
/WEB-INF/lib/taglibs-page.jar
  
  
http://jakarta.apache.org/taglibs/request-1.0
/WEB-INF/lib/taglibs-request.jar
  
  
http://jakarta.apache.org/taglibs/response-1.0
/WEB-INF/lib/taglibs-response.jar
  
  
http://jakarta.apache.org/taglibs/session-1.0
/WEB-INF/lib/taglibs-session.jar
  
  
http://jakarta.apache.org/taglibs/datetime-1.0
/WEB-INF/lib/taglibs-datetime.jar
  
  
http://jakarta.apache.org/taglibs/string-1.0.1
/WEB-INF/lib/taglibs-string.jar
  
  
http://jakarta.apache.org/taglibs/utility
/WEB-I

Re: Reload Message resources i.e Resource Bundle

2006-08-17 Thread Rahul Akolkar

On 8/17/06, Harsh Gupta <[EMAIL PROTECTED]> wrote:


How to Reload Message resources i.e Resource Bundles in struts 1.1???




Create a "reloadable" message resources factory, see factory attribute
[1] of 

-Rahul

[1] http://struts.apache.org/1.x/userGuide/configuration.html#resources_config

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reload Message resources i.e Resource Bundle

2006-08-17 Thread Monkeyden

I usually just touch the web.xml, to redeploy the app, but this isn't always
feasible in production.

On 8/17/06, Harsh Gupta <[EMAIL PROTECTED]> wrote:


How to Reload Message resources i.e Resource Bundles in struts 1.1???



___
Harsh Gupta
Software Engineer
MPS Technologies (A Macmillan company)

Email: h <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
Web:  <http://www.mpstechnologies.com/> www.mpstechnologies.com

Tel:  + 91 124 2704 111 (Direct Line)

  + 91 124 2704 100 (Board)
Fax:+ 91 124 288  1052

Mail: MPS Technologies, 3A, 4th & 5th Floors, DLF Corporate Park, Gurgaon
122 002, Haryana, India







Reload Message resources i.e Resource Bundle

2006-08-16 Thread Harsh Gupta
How to Reload Message resources i.e Resource Bundles in struts 1.1???

 

___ 
Harsh Gupta
Software Engineer
MPS Technologies (A Macmillan company)

Email: h <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
Web:  <http://www.mpstechnologies.com/> www.mpstechnologies.com 

Tel:  + 91 124 2704 111 (Direct Line) 

   + 91 124 2704 100 (Board)
Fax:+ 91 124 288  1052

Mail: MPS Technologies, 3A, 4th & 5th Floors, DLF Corporate Park, Gurgaon
122 002, Haryana, India 

 



[solved] message resources

2006-06-08 Thread Marcus

Samere, Adam J schrieb:

Internally the DynaForm (i.e. DynaBean) uses a Map to store the
properties. This is what allows it to provide dynamic properties and
save you from writing ActionForm subclasses.

When you reference myDynaForm with a JSP Expression Language (EL)
expression like ${myDynaForm.description} reflection is used to call a
getter method (in this case getDescription() on the instance
(myDynaForm). 


So... ${myDynaForm.description} is equivalent to
myDynaForm.getDescription()

The DynaForm class does not have this method. It does however have a
method public Map getMap() which returns the Map used to store your
properties. So, by putting ${myDynaForm.map.description} the equivalent
is myDynaForm.getMap().get("description") which will return your
property.

When using the struts bean tags such as bean write the tags are aware of
the DynaBean, and therefore know that they need to get the underlying
Map, then call get(String) using the supplied property.

Make sense?

-Adam
  
Make sense? YES! 


And it works, works, works... ;-)


Marcus


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: message resources

2006-06-08 Thread Samere, Adam J
Internally the DynaForm (i.e. DynaBean) uses a Map to store the
properties. This is what allows it to provide dynamic properties and
save you from writing ActionForm subclasses.

When you reference myDynaForm with a JSP Expression Language (EL)
expression like ${myDynaForm.description} reflection is used to call a
getter method (in this case getDescription() on the instance
(myDynaForm). 

So... ${myDynaForm.description} is equivalent to
myDynaForm.getDescription()

The DynaForm class does not have this method. It does however have a
method public Map getMap() which returns the Map used to store your
properties. So, by putting ${myDynaForm.map.description} the equivalent
is myDynaForm.getMap().get("description") which will return your
property.

When using the struts bean tags such as bean write the tags are aware of
the DynaBean, and therefore know that they need to get the underlying
Map, then call get(String) using the supplied property.

Make sense?

-Adam

-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 9:47 AM
To: Struts Users Mailing List
Subject: Re: message resources

>
> When using EL with dyna beans you need to reference the map property 
> then your property. The struts tags (i.e. bean:write) handle this for 
> you.
>
>  

Re: message resources

2006-06-08 Thread Dave Newton
Marcus wrote:
>> When using EL with dyna beans you need to reference the map property
>> then your property. The struts tags (i.e. bean:write) handle this for
>> you.
>>
>>  
> Or do you really mean a map? I am not using one..

...but you're using a DynaForm, so you are, so just do what he said ;)

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus


When using EL with dyna beans you need to reference the map property
then your property. The struts tags (i.e. bean:write) handle this for
you.

 

Sorry,

call me dumb,
but I didn't really get what you tried to explain.

EL ?
- map property  - you mean my dynaForm?
Or do you really mean a map? I am not using one..

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: message resources

2006-06-08 Thread Samere, Adam J
When using EL with dyna beans you need to reference the map property
then your property. The struts tags (i.e. bean:write) handle this for
you.

 

-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 9:28 AM
To: Struts Users Mailing List
Subject: Re: message resources


> Nope... That means Servlet spec 2.2, which is less than you need ;)
>
> Pre-advice caveat: I've never figured out XML, DOCTYPEs, and people 
> make fun of me for it.
>
> http://java.sun.com/xml/ns/j2ee";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
>
> Try that and see what happens... You can always do a sanity check JSP 
> page by displaying something you know to be a scoped value.

Now I get thrown an error that it can't find  the value! yaho! ;-)

javax.servlet.ServletException: Unable to find a value for "description"
in object of class "org.apache.struts.validator.DynaValidatorForm" using
operator "."




However, this does work!!!
  
 
???

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus



Nope... That means Servlet spec 2.2, which is less than you need ;)

Pre-advice caveat: I've never figured out XML, DOCTYPEs, and people make
fun of me for it.

http://java.sun.com/xml/ns/j2ee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

Try that and see what happens... You can always do a sanity check JSP
page by displaying something you know to be a scoped value.


Now I get thrown an error that it can't find  the value! yaho! ;-)

javax.servlet.ServletException: Unable to find a value for "description" in object of class 
"org.apache.struts.validator.DynaValidatorForm" using operator "."




However, this does work!!!
 

???

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Dave Newton
Marcus wrote:
>   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
>
>
> 2.2 means 2.0-ish, I assume?

Nope... That means Servlet spec 2.2, which is less than you need ;)

Pre-advice caveat: I've never figured out XML, DOCTYPEs, and people make
fun of me for it.

http://java.sun.com/xml/ns/j2ee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

Try that and see what happens... You can always do a sanity check JSP
page by displaying something you know to be a scoped value.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus

http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>


2.2 means 2.0-ish, I assume?

Marcus

Dave Newton schrieb:

Marcus wrote:
  

Any ideas?



What does your web.xml DOCTYPE look like? Irritatingly enough, you have
to tell Tomcat to go ahead and be 2.0-ish.

Dave



-
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: message resources

2006-06-08 Thread Dave Newton
Marcus wrote:
> Any ideas?

What does your web.xml DOCTYPE look like? Irritatingly enough, you have
to tell Tomcat to go ahead and be 2.0-ish.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus

Mine is to either use a JSP 2.0 container so the original EL suggestion
${myBean.value} EL will work, or use the struts-el tags if you're using
a < JSP 2.0 container, which will do the same thing in a different way.


I am using Apache Tomcat 5.5, and AFAIK, it does support JSP 2.0.

For "myBean" I used my dynaActionForm - but it didn't work.

My struts-config:
 
   


   
 

My properties file:
valueAdded=Value {0} added.

My JSP:
   value="true">
   arg0="${MyDynaActionForm.description}"/>

   

Any ideas?

Thx,

Marcus



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Dave Newton

> From: Marcus [mailto:[EMAIL PROTECTED] 
>   
> Value "myValue" has been added.
> (With the value of "myValue" printed!)
>   

Anyway, you've gotten a lot of... advice.

Mine is to either use a JSP 2.0 container so the original EL suggestion
${myBean.value} EL will work, or use the struts-el tags if you're using
a < JSP 2.0 container, which will do the same thing in a different way.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus

>It's awfull, but assuming you have myDynaForm in some scope should work
Yes, indeed! ;-)

Isn't there something more struts like (using tags..)

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread David Delbecq

Marcus wrote:

> 

I wrote:


And it returns literally:
${myDynaForm.value}


Sorry, thought bean:message was supporting el notation :)

try this



It's awfull, but assuming you have myDynaForm in some scope should work

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: message resources

2006-06-08 Thread Mukta
It will be displayed as a message only.
For code-cleaning purpose, since it gives an incorrect interpretation, you
can achieve the same result by slightly manipulating this code. Try
replacing ActionErrors with ActionMessages
In jsp also, replace  with 
It should work.

Actually I had that implementation for error messages in my project. So, I
just sent that code to you :)




-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 3:01 PM
To: Struts Users Mailing List
Subject: Re: message resources

>In your Action class, add following statements before return statement:
>ActionMessages oMsgs = new ActionErrors();
>
oMsgs.add(ActionMessages.GLOBAL_MESSAGE, 
>new ActionMessage("myValueAdded", ""));
>saveErrors(oRequest.getSession(), oMsgs);
>In your jsp, you must be having 
>It will work.


It's not an error, it's just a message to the user.

Marcus

-
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: message resources

2006-06-08 Thread Marcus

In your Action class, add following statements before return statement:
ActionMessages oMsgs = new ActionErrors();

oMsgs.add(ActionMessages.GLOBAL_MESSAGE, 

new ActionMessage("myValueAdded", ""));
saveErrors(oRequest.getSession(), oMsgs);
In your jsp, you must be having 
It will work.



It's not an error, it's just a message to the user.

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: message resources

2006-06-08 Thread Mukta
In your Action class, add following statements before return statement:

ActionMessages oMsgs = new ActionErrors();
oMsgs.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage("myValueAdded", ""));
saveErrors(oRequest.getSession(), oMsgs);

In your jsp, you must be having 
It will work.



-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 2:44 PM
To: Struts Users Mailing List
Subject: Re: message resources

 > 

I wrote:


And it returns literally:
${myDynaForm.value}

>What do you have in the java class for the value you want to put in your
>message, is it a has table or something else ?

It's all just plain simple.
I store my value in a dynaForm, forward to an action,
compute stuff, forward to to a jsp,
and then I want to print
Value "YOURVALUE" has been added.

>What do you mean by " Action adds value"??
>Where does Action add this value?

My Action stores the value in a database,
that's basically all it does.
On the jsp, I want to show the user that storing the value
worked, and as a "proof" I want to redisplay the value the user typed in.


Marcus


-
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: message resources

2006-06-08 Thread Marcus

> 

I wrote:


And it returns literally:
${myDynaForm.value}


What do you have in the java class for the value you want to put in your
message, is it a has table or something else ?


It's all just plain simple.
I store my value in a dynaForm, forward to an action,
compute stuff, forward to to a jsp,
and then I want to print
Value "YOURVALUE" has been added.


What do you mean by " Action adds value"??
Where does Action add this value?


My Action stores the value in a database,
that's basically all it does.
On the jsp, I want to show the user that storing the value
worked, and as a "proof" I want to redisplay the value the user typed in.


Marcus


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: message resources

2006-06-08 Thread Olivier Bex
Hi,

What do you have in the java class for the value you want to put in your
message, is it a has table or something else ?

Olivier.

-Message d'origine-
De : Marcus [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 8 juin 2006 10:58
À : Struts Users Mailing List
Objet : Re: message resources

>Pass the argument {0} as follows:

>


I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable "myValue" to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread Mukta
What do you mean by " Action adds value"??
Where does Action add this value?


-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 2:30 PM
To: Struts Users Mailing List
Subject: Re: message resources

>Where do you want to print this message ?
I type in my value into a textbox.
Forward to action.
Action adds value, forwards to jsp.
Now jsp should say:

Value "myValue" has been added.
(With the value of "myValue" printed!)

>What type of data do you use ?
Strings

Marcus


-
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: message resources

2006-06-08 Thread Mukta
Try using 




-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 2:28 PM
To: Struts Users Mailing List
Subject: Re: message resources

>Pass the argument {0} as follows:

>


I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable "myValue" to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread David Delbecq


Marcus wrote:

Pass the argument {0} as follows:







I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable "myValue" to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread Mukta
I'm assuming that there is a key-value pair defined in your
message-resources (.properties) file as follows:

myValueAdded=my value {0} has been added.

And that you want to print a value at location {0} to be passed from some
jsp or some other file.



Moreover, you can pass upto 5 arguments using arg0, arg1, .., arg4 in the
same manner.

HTH,
Mukta.


-Original Message-
From: Mukta [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:40 PM
To: 'Struts Users Mailing List'
Subject: RE: message resources

Pass the argument {0} as follows:




-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:32 PM
To: Struts Users Mailing List
Subject: message resources

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
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]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus

Where do you want to print this message ?

I type in my value into a textbox.
Forward to action.
Action adds value, forwards to jsp.
Now jsp should say:

Value "myValue" has been added.
(With the value of "myValue" printed!)


What type of data do you use ?

Strings

Marcus


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message resources

2006-06-08 Thread Marcus

Pass the argument {0} as follows:







I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable "myValue" to be printed.
:-(

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: message resources

2006-06-08 Thread Olivier Bex
Hi Marcus,

Where do you want to print this message ?
What type of data do you use ?

Regards,
Olivier

-Message d'origine-
De : Marcus [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 8 juin 2006 10:02
À : Struts Users Mailing List
Objet : message resources

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
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: message resources

2006-06-08 Thread Mukta
Pass the argument {0} as follows:




-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:32 PM
To: Struts Users Mailing List
Subject: message resources

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
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]



message resources

2006-06-08 Thread Marcus

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



loading message resources from a webapp location

2006-05-16 Thread tim.fulcher
Hi
 
We wish to load message resources from a local url within our webapp. I can't 
see an easy way to obtain servlet context within my MessageResourcesFactory / 
MessageResources implementations. Am I missing something here? 
Also ( yeah I know this is often raised), if I were to wipe the servlet context 
attribute  "" 
programmatically, will that get Struts to reload message resources again or is 
it a plain bad idea  :)
 
ps:I'm using struts 1.2.7
 
thanks
 
Tim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: message-resources key/parameter

2006-05-10 Thread josh t
Thanks Niall, That was very helpful. 
   
  I have another issue with my validator.xml.  Based on my investigation, I 
have configured everything correctly. But there must be something wrong with 
this basic and barebone validator.xml file, because even if I change the form 
name to something bogus, I don't get any sort of errors.  So I think for some 
reason, my form name in struts-config doesn't map to the form name in 
validation.xml.  
   
  Note:
   -  I'm using tiles.  Do I need to do anything in my tiles-defs.xml.
   - Also, I'm using Struts 1.1 (although even though I'm using 1.1 I needed to 
add the commons-validator.jar to my classpath) 
   
  Here is my entire validation.xml:
   
  http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>
   
  
  
  


  
  

   
 
   
  
  
  
  
  /form-validation>
   
   
  From my struts-config.xml
  
  
  
  

Niall Pemberton <[EMAIL PROTECTED]> wrote:
  This explains how "key" is used:
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section6

In respect of validator, although it has had a "bundle" attribute
(which is the same as "key" in struts-config.xml) for a while, it was
only actually supported since Struts 1.2.7 and Validator 1.1.4:

http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section7_2

Niall


On 5/10/06, josh t wrote:
> 
> 
>
> Can someone please explain to me how and where in my code I need to refer to 
> message-resources key? When doing validation, how does the validator know 
> where to loopup the ApplicationResources? Do I need to include the key 
> somwhere in my validator.xml?
>
> Thanks!
>
>
>
>
> -
> Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 

Re: message-resources key/parameter

2006-05-10 Thread Niall Pemberton

This explains how "key" is used:
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section6

In respect of validator, although it has had a "bundle" attribute
(which is the same as "key" in struts-config.xml) for a while, it was
only actually supported since Struts 1.2.7 and Validator 1.1.4:

http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section7_2

Niall


On 5/10/06, josh t <[EMAIL PROTECTED]> wrote:

  
  

 Can someone please explain to me how and where in my code I need to refer to 
message-resources key?  When doing validation, how does the validator know 
where to loopup the ApplicationResources?  Do I need to include the key 
somwhere in my validator.xml?

 Thanks!




-
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



message-resources key/parameter

2006-05-10 Thread josh t
  
   
   
  Can someone please explain to me how and where in my code I need to refer to 
message-resources key?  When doing validation, how does the validator know 
where to loopup the ApplicationResources?  Do I need to include the key 
somwhere in my validator.xml?
   
  Thanks!




-
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

Re:Cannot find message resources under key org.apache.struts.action.MESSAGE , what could cause this ?

2006-03-14 Thread starki78
Check your Definition in Struts-Config
and compare it with the location of the properties-file
and the call in the jsp.
In my experience it was always there a faulty configuration.

Saluti



-- Initial Header ---

>From  : "Legolas Woodland" [EMAIL PROTECTED]
To  : "Struts Users Mailing List" user@struts.apache.org
Cc  :
Date  : Wed, 15 Mar 2006 01:39:54 +0430
Subject : Cannot find message resources under key 
org.apache.struts.action.MESSAGE , what could cause this ?







> Hi
> Thank you for reading my post.
> I upload a web application to its host , it works OK until a few hours 
> ago , and now it shows the following exception
> is there any comment about this ?
>
>
> javax.servlet.jsp.JspException: Cannot find message resources under key 
> org.apache.struts.action.MESSAGE
>   
> org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1103)
>   org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
>   org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
>   
> org.apache.jsp.index_jsp._jspx_meth_bean_message_0(org.apache.jsp.index_jsp:138)
>   
> org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:106)
>   org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:70)
>   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
>   
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
>
>
>
> -
> 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]



Cannot find message resources under key org.apache.struts.action.MESSAGE , what could cause this ?

2006-03-14 Thread Legolas Woodland

Hi
Thank you for reading my post.
I upload a web application to its host , it works OK until a few hours 
ago , and now it shows the following exception

is there any comment about this ?


javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE

org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1103)
org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)

org.apache.jsp.index_jsp._jspx_meth_bean_message_0(org.apache.jsp.index_jsp:138)

org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:106)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)

com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Using message resources in non-action class

2006-03-14 Thread starki78
Thanks a lot
it works!!!

-- Initial Header ---

>From  : "Anuradha S.Athreya" [EMAIL PROTECTED]
To  : "Struts Users Mailing List" user@struts.apache.org
Cc  :
Date  : Tue, 14 Mar 2006 14:23:43 +0530
Subject : RE: Using message resources in non-action class







> I found the solution to my pblm as soon I sent out the previous mail.
>
> It is possible to access the resource bundle in a plain java class:
>
> If u have declared ur resource bundle in the struts-config.xml file as given
> below:
>   
>
> U'll have to access this bundle in ur plain java class as follows:
> MessageResources messageResources =
> MessageResources.getMessageResources("resources.application");
> String message = messageResources .getMessage("login.failure");
>
> -Original Message-
> From: starki78 [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 13, 2006 1:21 PM
> To: user
> Subject: RE: Using message resources in non-action class
>
> Yes this is a good solution!
> Do you also have a solution
> to access these message resources from a plain java-class there you don't
> have the servlet context?
>
> Nice greetings
>
>
> -- Initial Header ---
>
> >From  : [EMAIL PROTECTED]
> To  : user@struts.apache.org, [EMAIL PROTECTED]
> Cc  :
> Date  : Mon, 13 Mar 2006 13:11:34 +0530
> Subject : RE: Using message resources in non-action class
>
>
>
>
>
>
>
> >
> > The following should work.
> >
> > MessageResources messageresources = (MessageResources)
> > servlet.getServletContext().getAttribute("allMessages");
> >
> >
> > Chandra
> >
> > -Original Message-
> > From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 13, 2006 1:09 PM
> > To: 'Struts Users Mailing List'
> > Subject: Using message resources in non-action class
> >
> > In my struts application, I have resources file application.properties.
> > This has been configured in the struts-config.xml file
> >
> >   > />
> >
> >  Now, I would like to use this in my source code , in a non-action
> > class.
> >
> >  I tried the following
> >
> >  MessageResources messageresources =
> > MessageResources.getMessageResources("allMessages");
> >
> >  When i tried to retrieve the message in the file
> >
> >  String message = messageresources.getMessage("username.invalid");
> >
> >  the message is null,altho' corresponding message for the key
> > "username.invalid" is defined in the application.properties file.
> >
> > Can someone indicate the missing link?
> >
> > Regards,
> > Anuradha S.Athreya
> >
> >
> > -
> > 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]
>
>
>
>
> -
> 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: Using message resources in non-action class

2006-03-14 Thread Anuradha S.Athreya
I found the solution to my pblm as soon I sent out the previous mail.

It is possible to access the resource bundle in a plain java class:

If u have declared ur resource bundle in the struts-config.xml file as given
below:
 

U'll have to access this bundle in ur plain java class as follows:
MessageResources messageResources =
MessageResources.getMessageResources("resources.application");
String message = messageResources .getMessage("login.failure");

-Original Message-
From: starki78 [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 13, 2006 1:21 PM
To: user
Subject: RE: Using message resources in non-action class

Yes this is a good solution!
Do you also have a solution
to access these message resources from a plain java-class there you don't
have the servlet context?

Nice greetings


-- Initial Header ---

>From  : [EMAIL PROTECTED]
To  : user@struts.apache.org, [EMAIL PROTECTED]
Cc  : 
Date  : Mon, 13 Mar 2006 13:11:34 +0530
Subject : RE: Using message resources in non-action class







> 
> The following should work.
> 
> MessageResources messageresources = (MessageResources) 
> servlet.getServletContext().getAttribute("allMessages");
> 
> 
> Chandra
> 
> -Original Message-
> From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 13, 2006 1:09 PM
> To: 'Struts Users Mailing List'
> Subject: Using message resources in non-action class
> 
> In my struts application, I have resources file application.properties.
> This has been configured in the struts-config.xml file
> 
>   />
>  
>  Now, I would like to use this in my source code , in a non-action 
> class.
>  
>  I tried the following
>  
>  MessageResources messageresources =
> MessageResources.getMessageResources("allMessages");
>  
>  When i tried to retrieve the message in the file
>  
>  String message = messageresources.getMessage("username.invalid");
>  
>  the message is null,altho' corresponding message for the key 
> "username.invalid" is defined in the application.properties file.
> 
> Can someone indicate the missing link?
> 
> Regards,
> Anuradha S.Athreya
> 
> 
> -
> 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]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Recall: Using message resources in non-action class

2006-03-13 Thread Anuradha S.Athreya
Anuradha S.Athreya would like to recall the message, "Using message
resources in non-action class".

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Using message resources in non-action class

2006-03-13 Thread Chandra.Ravinithala
 
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html

Check the description for the following method: 
public static ResourceBundle getBundle(String baseName, Locale locale,
ClassLoader loader)

Give it a shot

Chandra

-Original Message-
From: starki78 [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 13, 2006 2:32 PM
To: user
Subject: RE: Using message resources in non-action class

Hi This would be a very good solution but when I test it this way:

 public static void main(String args[])
  {
   ResourceBundle messageresources =
   ResourceBundle.getBundle("ApplicationResources");
 }

I always get an exception: 
java.util.MissingResourceException: Can't find bundle for base name
ApplicationResources

The test class is in the same path as the bundle!

Can you help me?

Nice greetings
Starky
 


-- Initial Header ---

>From  : [EMAIL PROTECTED]
To  : user@struts.apache.org
Cc  : 
Date  : Mon, 13 Mar 2006 14:08:09 +0530
Subject : RE: Using message resources in non-action class







> Use resource bundle:
> 
> ResourceBundle messageresources  =
> ResourceBundle.getBundle("ApplicationResources");
> 
> Or
> 
> Properties messageresources = new Properties();
> BufferedInputStream is = new BufferedInputStream(
> getClass().getResourceAsStream("ApplicationResources"));
> properties.load(is);
> 
> Chandra
> 
> 
> 
> -Original Message-
> From: starki78 [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 13, 2006 1:21 PM
> To: user
> Subject: RE: Using message resources in non-action class
> 
> Yes this is a good solution!
> Do you also have a solution
> to access these message resources from a plain java-class there you
> don't have the servlet context?
> 
> Nice greetings
> 
> 
> -- Initial Header ---
> 
> From  : [EMAIL PROTECTED]
> To  : user@struts.apache.org, [EMAIL PROTECTED]
> Cc  : 
> Date  : Mon, 13 Mar 2006 13:11:34 +0530
> Subject : RE: Using message resources in non-action class
> 
> 
> 
> 
> 
> 
> 
> > 
> > The following should work.
> > 
> > MessageResources messageresources = (MessageResources) 
> > servlet.getServletContext().getAttribute("allMessages");
> > 
> > 
> > Chandra
> > 
> > -Original Message-
> > From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 13, 2006 1:09 PM
> > To: 'Struts Users Mailing List'
> > Subject: Using message resources in non-action class
> > 
> > In my struts application, I have resources file
> application.properties.
> > This has been configured in the struts-config.xml file
> > 
> >   parameter="resources.application"
> > />
> >  
> >  Now, I would like to use this in my source code , in a non-action 
> > class.
> >  
> >  I tried the following
> >  
> >  MessageResources messageresources =
> > MessageResources.getMessageResources("allMessages");
> >  
> >  When i tried to retrieve the message in the file
> >  
> >  String message = messageresources.getMessage("username.invalid");
> >  
> >  the message is null,altho' corresponding message for the key 
> > "username.invalid" is defined in the application.properties file.
> > 
> > Can someone indicate the missing link?
> > 
> > Regards,
> > Anuradha S.Athreya
> > 
> > 
> >
-
> > 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]
> 
> -
> 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]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Using message resources in non-action class

2006-03-13 Thread starki78
Hi This would be a very good solution but when
I test it this way:

 public static void main(String args[])
  {
   ResourceBundle messageresources =
   ResourceBundle.getBundle("ApplicationResources");
 }

I always get an exception:
java.util.MissingResourceException: Can't find bundle for base name 
ApplicationResources

The test class is in the same path as the bundle!

Can you help me?

Nice greetings
Starky



-- Initial Header ---

>From  : [EMAIL PROTECTED]
To  : user@struts.apache.org
Cc  :
Date  : Mon, 13 Mar 2006 14:08:09 +0530
Subject : RE: Using message resources in non-action class







> Use resource bundle:
>
> ResourceBundle messageresources  =
> ResourceBundle.getBundle("ApplicationResources");
>
> Or
>
> Properties messageresources = new Properties();
> BufferedInputStream is = new BufferedInputStream(
> getClass().getResourceAsStream("ApplicationResources"));
> properties.load(is);
>
> Chandra
>
>
>
> -Original Message-
> From: starki78 [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 13, 2006 1:21 PM
> To: user
> Subject: RE: Using message resources in non-action class
>
> Yes this is a good solution!
> Do you also have a solution
> to access these message resources from a plain java-class there you
> don't have the servlet context?
>
> Nice greetings
>
>
> -- Initial Header ---
>
> From  : [EMAIL PROTECTED]
> To  : user@struts.apache.org, [EMAIL PROTECTED]
> Cc  :
> Date  : Mon, 13 Mar 2006 13:11:34 +0530
> Subject : RE: Using message resources in non-action class
>
>
>
>
>
>
>
> >
> > The following should work.
> >
> > MessageResources messageresources = (MessageResources)
> > servlet.getServletContext().getAttribute("allMessages");
> >
> >
> > Chandra
> >
> > -Original Message-
> > From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 13, 2006 1:09 PM
> > To: 'Struts Users Mailing List'
> > Subject: Using message resources in non-action class
> >
> > In my struts application, I have resources file
> application.properties.
> > This has been configured in the struts-config.xml file
> >
> >   parameter="resources.application"
> > />
> >
> >  Now, I would like to use this in my source code , in a non-action
> > class.
> >
> >  I tried the following
> >
> >  MessageResources messageresources =
> > MessageResources.getMessageResources("allMessages");
> >
> >  When i tried to retrieve the message in the file
> >
> >  String message = messageresources.getMessage("username.invalid");
> >
> >  the message is null,altho' corresponding message for the key
> > "username.invalid" is defined in the application.properties file.
> >
> > Can someone indicate the missing link?
> >
> > Regards,
> > Anuradha S.Athreya
> >
> >
> > -
> > 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]
>
> -
> 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: Using message resources in non-action class

2006-03-13 Thread Chandra.Ravinithala
Use resource bundle:

ResourceBundle messageresources  =
ResourceBundle.getBundle("ApplicationResources");

Or

Properties messageresources = new Properties();
BufferedInputStream is = new BufferedInputStream(
getClass().getResourceAsStream("ApplicationResources"));
properties.load(is);

Chandra



-Original Message-
From: starki78 [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 13, 2006 1:21 PM
To: user
Subject: RE: Using message resources in non-action class

Yes this is a good solution!
Do you also have a solution
to access these message resources from a plain java-class there you
don't have the servlet context?

Nice greetings


-- Initial Header ---

>From  : [EMAIL PROTECTED]
To  : user@struts.apache.org, [EMAIL PROTECTED]
Cc  : 
Date  : Mon, 13 Mar 2006 13:11:34 +0530
Subject : RE: Using message resources in non-action class







> 
> The following should work.
> 
> MessageResources messageresources = (MessageResources) 
> servlet.getServletContext().getAttribute("allMessages");
> 
> 
> Chandra
> 
> -Original Message-
> From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 13, 2006 1:09 PM
> To: 'Struts Users Mailing List'
> Subject: Using message resources in non-action class
> 
> In my struts application, I have resources file
application.properties.
> This has been configured in the struts-config.xml file
> 
>   />
>  
>  Now, I would like to use this in my source code , in a non-action 
> class.
>  
>  I tried the following
>  
>  MessageResources messageresources =
> MessageResources.getMessageResources("allMessages");
>  
>  When i tried to retrieve the message in the file
>  
>  String message = messageresources.getMessage("username.invalid");
>  
>  the message is null,altho' corresponding message for the key 
> "username.invalid" is defined in the application.properties file.
> 
> Can someone indicate the missing link?
> 
> Regards,
> Anuradha S.Athreya
> 
> 
> -
> 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]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Using message resources in non-action class

2006-03-12 Thread starki78
Yes this is a good solution!
Do you also have a solution
to access these message resources from a
plain java-class there you don't have the servlet context?

Nice greetings


-- Initial Header ---

>From  : [EMAIL PROTECTED]
To  : user@struts.apache.org, [EMAIL PROTECTED]
Cc  :
Date  : Mon, 13 Mar 2006 13:11:34 +0530
Subject : RE: Using message resources in non-action class







>
> The following should work.
>
> MessageResources messageresources = (MessageResources)
> servlet.getServletContext().getAttribute("allMessages");
>
>
> Chandra
>
> -Original Message-
> From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 13, 2006 1:09 PM
> To: 'Struts Users Mailing List'
> Subject: Using message resources in non-action class
>
> In my struts application, I have resources file application.properties.
> This has been configured in the struts-config.xml file
>
>   />
>
>  Now, I would like to use this in my source code , in a non-action
> class.
>
>  I tried the following
>
>  MessageResources messageresources =
> MessageResources.getMessageResources("allMessages");
>
>  When i tried to retrieve the message in the file
>
>  String message = messageresources.getMessage("username.invalid");
>
>  the message is null,altho' corresponding message for the key
> "username.invalid" is defined in the application.properties file.
>
> Can someone indicate the missing link?
>
> Regards,
> Anuradha S.Athreya
>
>
> -
> 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: Using message resources in non-action class

2006-03-12 Thread Chandra.Ravinithala

The following should work.

MessageResources messageresources = (MessageResources)
servlet.getServletContext().getAttribute("allMessages"); 


Chandra

-Original Message-
From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 13, 2006 1:09 PM
To: 'Struts Users Mailing List'
Subject: Using message resources in non-action class

In my struts application, I have resources file application.properties.
This has been configured in the struts-config.xml file 

 
 
 Now, I would like to use this in my source code , in a non-action
class. 
 
 I tried the following 
 
 MessageResources messageresources =
MessageResources.getMessageResources("allMessages");
 
 When i tried to retrieve the message in the file 
 
 String message = messageresources.getMessage("username.invalid"); 
 
 the message is null,altho' corresponding message for the key
"username.invalid" is defined in the application.properties file.

Can someone indicate the missing link?

Regards,
Anuradha S.Athreya 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Using message resources in non-action class

2006-03-12 Thread Anuradha S.Athreya
In my struts application, I have resources file application.properties. This
has been configured in the struts-config.xml file 

 
 
 Now, I would like to use this in my source code , in a non-action class. 
 
 I tried the following 
 
 MessageResources messageresources =
MessageResources.getMessageResources("allMessages");
 
 When i tried to retrieve the message in the file 
 
 String message = messageresources.getMessage("username.invalid"); 
 
 the message is null,altho' corresponding message for the key
"username.invalid" is defined in the application.properties file.

Can someone indicate the missing link?

Regards,
Anuradha S.Athreya 




Re: Cannot find message resources under key org.apache.struts.action.MESSAGE

2006-02-27 Thread Laurie Harper
Did you define the message resources in struts-config.xml? The init 
param in web.xml isn't used in current versions of Struts. Make sure you 
have this in your struts-config:


  

L.

red phoenix wrote:

I have configure my properties file,but when run,it raise error and say
can't find message key,my files are follows:
/*index.jsp*/
<%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>

...



/*application.properties*/
error.header=
error.footer=
error.stime.required=This is a test

/*LogmanageForm.java*/
...
public ActionErrors validate(ActionMapping mapping,HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
..
errors.add("logstime",new ActionError("error.stime.required"));
return errors;
}

/*web.xml*/

http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

  
  
   action
org.apache.struts.action.ActionServlet
  
  application
  resources.application

...


/*struts-config.xml*/

http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>

  

  
  

  

  


application.properties is locate follow directory:
C:\tomcat5\webapps\Log\WEB-INF\classes\resources\application.properties

When the JSP execute ,it raise following
error:
javax.servlet.ServletException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:791)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java
:1062)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(
RequestProcessor.java:1000)
org.apache.struts.action.RequestProcessor.processValidate(
RequestProcessor.java:965)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I have configure the application.properties,why raise above error?
Thanks in advance!

Best Regards,
phoenix




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cannot find message resources under key org.apache.struts.action.MESSAGE

2006-02-27 Thread Dharmendra Singh
Dear
First give the right tag URI in right form  in index.jsp
whatever u have given in web.xml


On 2/27/06, red phoenix <[EMAIL PROTECTED]> wrote:
>
> I have configure my properties file,but when run,it raise error and say
> can't find message key,my files are follows:
> /*index.jsp*/
> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>
> 
> ..
> 
> 
>
> /*application.properties*/
> error.header=
> error.footer=
> error.stime.required=This is a test
>
> /*LogmanageForm.java*/
> ..
> public ActionErrors validate(ActionMapping mapping,HttpServletRequest
> request) {
>ActionErrors errors = new ActionErrors();
>..
>errors.add("logstime",new ActionError("error.stime.required"));
>return errors;
> }
>
> /*web.xml*/
> 
>  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
> 
> 
> 
>   action
>org.apache.struts.action.ActionServlet
> 
>  application
>  resources.application
>
> ..
>
>
> /*struts-config.xml*/
> 
>   "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
>  "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>
> 
> 
>
> 
> 
>   type="com.LogmanageAction"
>   name="logmanageForm"
>   validate="true"
>   input="/index.jsp">
>  
>
> 
> 
>
> application.properties is locate follow directory:
> C:\tomcat5\webapps\Log\WEB-INF\classes\resources\application.properties
>
> When the JSP execute ,it raise following
> error:
> javax.servlet.ServletException: Cannot find message resources under key
> org.apache.struts.action.MESSAGE
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
> PageContextImpl.java:858)
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImpl.java:791)
> org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:91)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :332)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java
> :1062)
> org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(
> RequestProcessor.java:1000)
> org.apache.struts.action.RequestProcessor.processValidate(
> RequestProcessor.java:965)
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
> :204)
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
> I have configure the application.properties,why raise above error?
> Thanks in advance!
>
> Best Regards,
> phoenix
>
>


Cannot find message resources under key org.apache.struts.action.MESSAGE

2006-02-27 Thread red phoenix
I have configure my properties file,but when run,it raise error and say
can't find message key,my files are follows:
/*index.jsp*/
<%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>

..



/*application.properties*/
error.header=
error.footer=
error.stime.required=This is a test

/*LogmanageForm.java*/
..
public ActionErrors validate(ActionMapping mapping,HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
..
errors.add("logstime",new ActionError("error.stime.required"));
return errors;
}

/*web.xml*/

http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

  
  
   action
org.apache.struts.action.ActionServlet
  
  application
  resources.application

..


/*struts-config.xml*/

http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>

  

  
  

  

  


application.properties is locate follow directory:
C:\tomcat5\webapps\Log\WEB-INF\classes\resources\application.properties

When the JSP execute ,it raise following
error:
javax.servlet.ServletException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:791)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java
:1062)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(
RequestProcessor.java:1000)
org.apache.struts.action.RequestProcessor.processValidate(
RequestProcessor.java:965)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I have configure the application.properties,why raise above error?
Thanks in advance!

Best Regards,
phoenix


Re: Struts Message Resources

2006-02-21 Thread Dave Newton
Jim Reynolds wrote:
> All is good. But I have created some tag libraries, in which run in
> the same struts app, and I need to get to them. I know you can get the
> properties from an action class through the struts api ... but is
> there anyway to get them from the application context, when you are in
> a tag.
>   
I honestly don't remember how I did that, but I do know I figured it out
by looking at the source code for the message tag.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts Message Resources

2006-02-21 Thread Jim Reynolds
I have a struts application in which I use the message resources for
most of my view pages. Using bean:message, etc.

All is good. But I have created some tag libraries, in which run in
the same struts app, and I need to get to them. I know you can get the
properties from an action class through the struts api ... but is
there anyway to get them from the application context, when you are in
a tag.

When I look through the struts api, it looks like struts is storing it
in the application context ... but I am not sure where or how I can
get them. In Mesage Resources Configurtion it shows this:

key - ServletContext attribute key to store this bundle.
[org.apache.struts.action.MESSAGE] (optional)

But it was my knowledge tht key was just another property file, and
you can use the key when using the property.

Any help would be appreciated.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: formatting messages in different colours from Message Resources

2006-01-11 Thread Laurie Harper

Raghuveer wrote:

Dear AGary and Alexandre
I changed my Message KEY " msg.insert.failed" as below


msg.insert.failed = Insert failed.



In my JSP PAGE message is displayed with FONT tags.
HTML tags are not being executed with message .
Insert failed.

so from above when HTML font tag could not be executed ,how come CSS style
would work.

Could Any one help me to resolve this issue.


Make sure you include escape="false" in your bean:message tag if you 
want to in-line markup like that.


L.



-Original Message-
From: Alexandre Poitras [mailto:[EMAIL PROTECTED]
Sent: Monday, January 09, 2006 7:35 PM
To: Struts Users Mailing List
Subject: Re: formatting messages in different colours


Or to be XHTML-compatible, use css styles :)

On 1/9/06, Gary Feidt <[EMAIL PROTECTED]> wrote:

Why not just throw a Insert failed. and Insert success. in you Message Resouces file.

Gary


[EMAIL PROTECTED] 1/9/2006 4:37 AM >>>

Can Any one provide me information regarding display of Messages from
Application Resources in different colours and FONTS.

Example:

I need to display messages based on Sucess or failure of Database
Operations.

I need to display messages in JSP Page as follows

1)  Successful database operations in RED color
2)  Failure database operations in BLUE color




--

--

------
Message Resources

messages.header=
messages.footer=
msg.insert.failed = Insert failed.
msg.insert.success = Insert success.


--

--

--
Message .jsp









--

--

--





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
__

Confidentiality Statement:
This email/fax, including attachments, may include confidential and/or
proprietary information and may be used only by the person or entity to
which it is addressed. If the reader of this email/fax is not the intended
recipient or his or her agent, the reader is hereby notified that any
dissemination, distribution or copying of this email/fax is prohibited. If
you have received this email/fax in error, please notify the sender by
replying to this message and deleting this email or destroying this
facsimile immediately.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Alexandre Poitras
Québec, Canada




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   3   >