RE: Multiple message-resources -- How to access? Struts 1.1

2003-10-30 Thread Rabago, Hubert
I'm worried about getting the same problem, except I don't want to go
back into all my components to add key parameters later on.  Is there
a way to break down a huge global properties file into several files
which all get added to the global resources?
Is this a feature worth asking for/working on?

-Original Message-
From: Lukas Bradley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 30, 2003 10:26 AM
To: [EMAIL PROTECTED]
Subject: Multiple message-resources -- How to access? Struts 1.1


Hi all,

I feel rather odd asking about this, because it seems it should be a
VERY simple task.

I've been using a single message-resource within my struts-config.xml
file. It's been working beautifully defined as: message-resources
parameter=MyTerms null=false/

When I have a file MyTerms.properties in my /WEB-INF/classes
directory.  I access my properties as such:

bean:message key=label.forum.subject /

And everything the world is perfect.

Except that my properties file has filled up with hundreds of terms, and
it is getting impossible to manage.  To make this easier, I decided to
define multiple message-resources in my struts-config.

message-resources parameter=MyTerms null=false/

message-resources parameter=msg.resource.errors key=msg.errors
null=false /

message-resources parameter=msg.forum key=msg.forum null=false /

It is my understanding that the initial MyTerms file will be stored
under the default resources property, and the other two will be stored
as msg.errors and msg.forum respectively.

However, when I try to access them, I get nothing.

bean:message key=label.forum messages=msg.forum/

bean:message key=label.forum name=msg.forum/

bean:message key=label.forum bundle=msg.forum/

None of the tags above work.  I even tried

bean:message property=label.forum bundle=msg.forum/

But that gives a NullPointerException.

So I'm stumped.  In the logs, the property file is being loaded during
startup, and my default property file still returns messages.

Any help?

Lukas










-
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: Multiple message-resources -- How to access? Struts 1.1

2003-10-30 Thread Lukas Bradley
It appears as if the properties file can not contain the . character.
This makes sense, because properties are considered to be Class files at run
time.  The dot-notation probably gets a little confusing.

This works:

message-resources parameter=MyForum key=msg.forum null=false/

bean:message key=label.forum bundle=msg.forum/

Where the properties file is named MyForum.properites.

Lukas


Lukas Bradley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 I feel rather odd asking about this, because it seems it should be a VERY
 simple task.

 I've been using a single message-resource within my struts-config.xml
file.
 It's been working beautifully defined as:
 message-resources parameter=MyTerms null=false/

 When I have a file MyTerms.properties in my /WEB-INF/classes directory.
I
 access my properties as such:

 bean:message key=label.forum.subject /

 And everything the world is perfect.

 Except that my properties file has filled up with hundreds of terms, and
it
 is getting impossible to manage.  To make this easier, I decided to define
 multiple message-resources in my struts-config.

 message-resources parameter=MyTerms null=false/

 message-resources parameter=msg.resource.errors key=msg.errors
 null=false /

 message-resources parameter=msg.forum key=msg.forum null=false /

 It is my understanding that the initial MyTerms file will be stored
under
 the default resources property, and the other two will be stored as
 msg.errors and msg.forum respectively.

 However, when I try to access them, I get nothing.

 bean:message key=label.forum messages=msg.forum/

 bean:message key=label.forum name=msg.forum/

 bean:message key=label.forum bundle=msg.forum/

 None of the tags above work.  I even tried

 bean:message property=label.forum bundle=msg.forum/

 But that gives a NullPointerException.

 So I'm stumped.  In the logs, the property file is being loaded during
 startup, and my default property file still returns messages.

 Any help?

 Lukas




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