You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2006/02/12 18:54:37 UTC
Looking for messages (in TAP4)
Up to now, I have been taking the simplistic approach to messages and putting
them all in myApplication.properties files.
This included a border component which I put in a library and then made into a
jar file and stored in tomcat's shared/lib directory - so that all my
applications could have a similar border.
In the java it did something like
getPage().getMessages().getMessage("key-string");
But as I develop this forward I want to do some more sophisticated things
(particularly with version numbers). Reading the userguide it hints at more
general message seaching, but it is not 100% explicit, so before I rip my
code to pieces to change things, I though I would ask here.
Assume I have a component called "Border" inside a library called "mylib", and
inside this library I have files Border.properties and mylib.properties.
These are all packed up into a jar file and placed in the shared/lib
directory.
If I have a application called MyApp with a page called MyPage with properties
file in the WEB-INF directory called MyApp.properties and MyPage.properties
If I replace the code currently in my Border component to and ignoring locales
for now
getMessages().getMessage("key-string")
What is the exact order of searching for the message key "key-string". I
think it will look in
Border.properties, mylib.properties, MyPage.properties, MyApp.properties
in that order, stopping at the first occurance of "key-string".
Am I correct?
or is it
Border.properties, MyPage.properties, mylib.properties, MyApp.properties
or something else
--
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Looking for messages (in TAP4)
Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Monday 13 February 2006 19:39, Alan Chandler wrote:
> On Monday 13 February 2006 18:50, Sven Homburg wrote:
> > hope this helps
> >
> > http://wiki.apache.org/jakarta-tapestry/UsingCustomResourceSourceForLibs
> > http://wiki.apache.org/jakarta-tapestry/ApplicationBorderComponent
>
> I doesn't explain what these are for. Is there a wiki page outlining what
Sorry that should have been
It doesn't explain what these are for.
> these achieve. Are you trying to set up some other handling of properties
> files, and if so what?
>
> I do have a working border component. Currently calling
I have conducted an experiment
>
> getPage().getMessages().getMessage("some-key")
If I have this is searches the Page.properties file and then the
Application.properties file (where the page is called Page)
It does NOT search the Border.properties (Border is the component) or the
library.properties file
>
> retrieves the key successfully from the Application.properties file.
>
>
> what I am asking in the question is if I change that to
>
> getMessages().getMessage("some-key")
If I have this it searches the Border.properties file then the
library.properties file it does NOT search the Page.properties and
Application.properties file
--
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Looking for messages (in TAP4)
Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Monday 13 February 2006 18:50, Sven Homburg wrote:
> hope this helps
>
> http://wiki.apache.org/jakarta-tapestry/UsingCustomResourceSourceForLibs
> http://wiki.apache.org/jakarta-tapestry/ApplicationBorderComponent
I doesn't explain what these are for. Is there a wiki page outlining what
these achieve. Are you trying to set up some other handling of properties
files, and if so what?
I do have a working border component. Currently calling
getPage().getMessages().getMessage("some-key")
retrieves the key successfully from the Application.properties file.
what I am asking in the question is if I change that to
getMessages().getMessage("some-key")
what order are properties files searched for now. That is what are ALL the
potential places where I could put a properties file and find the key
"some-key", and in what order are they searched (so if the key is in more
than one place, which one is found).
Since no one has responded up to now, I am about to try an experiment to find
out.
--
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Looking for messages (in TAP4)
Posted by Sven Homburg <Sv...@hsofttec.com>.
hope this helps
http://wiki.apache.org/jakarta-tapestry/UsingCustomResourceSourceForLibs
http://wiki.apache.org/jakarta-tapestry/ApplicationBorderComponent
Am Sunday 12 February 2006 18:54 schrieb Alan Chandler:
> Up to now, I have been taking the simplistic approach to messages and putting
> them all in myApplication.properties files.
>
> This included a border component which I put in a library and then made into a
> jar file and stored in tomcat's shared/lib directory - so that all my
> applications could have a similar border.
>
> In the java it did something like
> getPage().getMessages().getMessage("key-string");
>
> But as I develop this forward I want to do some more sophisticated things
> (particularly with version numbers). Reading the userguide it hints at more
> general message seaching, but it is not 100% explicit, so before I rip my
> code to pieces to change things, I though I would ask here.
>
> Assume I have a component called "Border" inside a library called "mylib", and
> inside this library I have files Border.properties and mylib.properties.
> These are all packed up into a jar file and placed in the shared/lib
> directory.
>
> If I have a application called MyApp with a page called MyPage with properties
> file in the WEB-INF directory called MyApp.properties and MyPage.properties
>
> If I replace the code currently in my Border component to and ignoring locales
> for now
>
> getMessages().getMessage("key-string")
>
> What is the exact order of searching for the message key "key-string". I
> think it will look in
>
> Border.properties, mylib.properties, MyPage.properties, MyApp.properties
>
> in that order, stopping at the first occurance of "key-string".
>
> Am I correct?
>
> or is it
>
> Border.properties, MyPage.properties, mylib.properties, MyApp.properties
>
> or something else
--
with best regards
homburg Softwaretechnik
S.Homburg
21220 Seevetal / GERMANY
Fon: +49-4105-669746
Fax: +49-4105-668947
-= Programming today is a race between software engineers striving to build bigger and better idiot-proof programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rich Cook =-
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org