You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lenny Primak <lp...@hope.nyc.ny.us> on 2011/02/21 20:05:29 UTC

Global Configuration/Logging/Properties files locations

Hi guys,
So far, I counted two places to put global properties in tapestry:
- WEB-INF/app.properties
- resources/log4j.properties

What is the proper place to put global properties, WEB-INF or resources?
Also, I am deploying on glassfish and I don't think log4j.properties actually works for this.
What's the proper logging level configuration solution in my case?

Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Bob Harner <bo...@gmail.com>.
Just a note: http://tapestry.apache.org/localization.html is the newer
version of that page.

On Mon, Feb 21, 2011 at 3:00 PM, Josh Canfield <jo...@gmail.com> wrote:
>> That's the question, what goes into resources (globally?)
>> i.e. resources/app.properties, etc.
>> Are there any other properties that goes into resources/ root folder?
>> And how does log4j.properties work in case of glassfish then/?
>
> log4j.properties is for log4j and is only included by the tapestry
> archetype as a convenience. When you put things into the resources
> folder they get copied into your compiled output hierarchy along side
> your classes. This is an artifact of the use of a traditional maven
> layout.
>
> Generally in Tapestry property files are used for localization.
>
> http://tapestry.apache.org/tapestry5/guide/localization.html
>
> <quote>
> Application Message Catalog
>
> If the file WEB-INF/AppName.properties exists in the context, it will
> be used as an application-wide message catalog. The AppName is derived
> from the name of the filter inside the web.xml file; this is most
> often just "app", thus WEB-INF/app.properties. The search for the file
> is case sensitive. The properties files may be localized.
> </quote>
>
>
> Josh
>
> On Mon, Feb 21, 2011 at 11:44 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>> That's the question, what goes into resources (globally?)
>> i.e. resources/app.properties, etc.
>> Are there any other properties that goes into resources/ root folder?
>> And how does log4j.properties work in case of glassfish then/?
>>
>> On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote:
>>
>>> On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>>
>>>> Hi guys,
>>>> So far, I counted two places to put global properties in tapestry:
>>>> - WEB-INF/app.properties
>>>> - resources/log4j.properties
>>>>
>>>> What is the proper place to put global properties, WEB-INF or resources?
>>>
>>> What are these properties? If they are messages used by Tapestry, app.properties. If not, resources.
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
>>> Owner, Ars Machina Tecnologia da Informação Ltda.
>>> http://www.arsmachina.com.br
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 28 Aug 2012 17:26:36 -0300, George Christman  
<gc...@cardaddy.com> wrote:

> Sorry Thiago, one last thing. Is there away to use the Messages service  
> with the contributeApplicationDefaults in AppModule.class?

I don't think so. Messages isn't a service.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by George Christman <gc...@cardaddy.com>.
Sorry Thiago, one last thing. Is there away to use the Messages service with
the contributeApplicationDefaults in AppModule.class?



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Global-Configuration-Logging-Properties-files-locations-tp3394564p5715857.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by George Christman <gc...@cardaddy.com>.
Thanks Thiago, worked perfectly. 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Global-Configuration-Logging-Properties-files-locations-tp3394564p5715853.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 28 Aug 2012 11:58:08 -0300, George Christman  
<gc...@cardaddy.com> wrote:

> Thanks Thiago, how do you make the app.properties available to your java
> classes?

In page classes, components and mixins, just @Inject Messages and use its  
get() method.
Another option is to use he same way you can read files from any Servlet  
API-based framework: get the ServletContext,
String path = getServletContext().getRealPath("/WEB-INF/" + fileName);
Use the Properties class to read the file at that path.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by George Christman <gc...@cardaddy.com>.
Thanks Thiago, how do you make the app.properties available to your java
classes?



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Global-Configuration-Logging-Properties-files-locations-tp3394564p5715851.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 28 Aug 2012 11:29:57 -0300, George Christman  
<gc...@cardaddy.com> wrote:

> I have a question in regards to this topic. I have global settings, ie  
> email settings such as from address etc. My boss, "non tapestry user"  
> wanted me to put them in the web-inf/app.properties folder. I'm not sure  
> this is the
> correct spot for them since I thought it was used for tapestry messaging.
> Where would the correct spot be and how would I access them in my java
> classes? Thanks.

I see no harm in using app.properties for that.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by George Christman <gc...@cardaddy.com>.
I have a question in regards to this topic. I have global settings, ie email
settings such as from address etc. My boss, "non tapestry user" wanted me to
put them in the web-inf/app.properties folder. I'm not sure this is the
correct spot for them since I thought it was used for tapestry messaging.
Where would the correct spot be and how would I access them in my java
classes? Thanks.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Global-Configuration-Logging-Properties-files-locations-tp3394564p5715847.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
So basically in my glassfish deployment, there is nothing
that needs to be put into resources/ folder, as far as tapestry configuration
is concerned, correct?
And the logging is controlled through glassfish itself, not through
a file in this folder.

Thanks for your answer/confirmation

On Feb 21, 2011, at 3:00 PM, Josh Canfield wrote:

>> That's the question, what goes into resources (globally?)
>> i.e. resources/app.properties, etc.
>> Are there any other properties that goes into resources/ root folder?
>> And how does log4j.properties work in case of glassfish then/?
> 
> log4j.properties is for log4j and is only included by the tapestry
> archetype as a convenience. When you put things into the resources
> folder they get copied into your compiled output hierarchy along side
> your classes. This is an artifact of the use of a traditional maven
> layout.
> 
> Generally in Tapestry property files are used for localization.
> 
> http://tapestry.apache.org/tapestry5/guide/localization.html
> 
> <quote>
> Application Message Catalog
> 
> If the file WEB-INF/AppName.properties exists in the context, it will
> be used as an application-wide message catalog. The AppName is derived
> from the name of the filter inside the web.xml file; this is most
> often just "app", thus WEB-INF/app.properties. The search for the file
> is case sensitive. The properties files may be localized.
> </quote>
> 
> 
> Josh
> 
> On Mon, Feb 21, 2011 at 11:44 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>> That's the question, what goes into resources (globally?)
>> i.e. resources/app.properties, etc.
>> Are there any other properties that goes into resources/ root folder?
>> And how does log4j.properties work in case of glassfish then/?
>> 
>> On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote:
>> 
>>> On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>> 
>>>> Hi guys,
>>>> So far, I counted two places to put global properties in tapestry:
>>>> - WEB-INF/app.properties
>>>> - resources/log4j.properties
>>>> 
>>>> What is the proper place to put global properties, WEB-INF or resources?
>>> 
>>> What are these properties? If they are messages used by Tapestry, app.properties. If not, resources.
>>> 
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
>>> Owner, Ars Machina Tecnologia da Informação Ltda.
>>> http://www.arsmachina.com.br
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Josh Canfield <jo...@gmail.com>.
> That's the question, what goes into resources (globally?)
> i.e. resources/app.properties, etc.
> Are there any other properties that goes into resources/ root folder?
> And how does log4j.properties work in case of glassfish then/?

log4j.properties is for log4j and is only included by the tapestry
archetype as a convenience. When you put things into the resources
folder they get copied into your compiled output hierarchy along side
your classes. This is an artifact of the use of a traditional maven
layout.

Generally in Tapestry property files are used for localization.

http://tapestry.apache.org/tapestry5/guide/localization.html

<quote>
Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will
be used as an application-wide message catalog. The AppName is derived
from the name of the filter inside the web.xml file; this is most
often just "app", thus WEB-INF/app.properties. The search for the file
is case sensitive. The properties files may be localized.
</quote>


Josh

On Mon, Feb 21, 2011 at 11:44 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> That's the question, what goes into resources (globally?)
> i.e. resources/app.properties, etc.
> Are there any other properties that goes into resources/ root folder?
> And how does log4j.properties work in case of glassfish then/?
>
> On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote:
>
>> On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>
>>> Hi guys,
>>> So far, I counted two places to put global properties in tapestry:
>>> - WEB-INF/app.properties
>>> - resources/log4j.properties
>>>
>>> What is the proper place to put global properties, WEB-INF or resources?
>>
>> What are these properties? If they are messages used by Tapestry, app.properties. If not, resources.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
That's the question, what goes into resources (globally?)
i.e. resources/app.properties, etc.
Are there any other properties that goes into resources/ root folder?
And how does log4j.properties work in case of glassfish then/?

On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote:

> On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> 
>> Hi guys,
>> So far, I counted two places to put global properties in tapestry:
>> - WEB-INF/app.properties
>> - resources/log4j.properties
>> 
>> What is the proper place to put global properties, WEB-INF or resources?
> 
> What are these properties? If they are messages used by Tapestry, app.properties. If not, resources.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Global Configuration/Logging/Properties files locations

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak <lp...@hope.nyc.ny.us>  
wrote:

> Hi guys,
> So far, I counted two places to put global properties in tapestry:
> - WEB-INF/app.properties
> - resources/log4j.properties
>
> What is the proper place to put global properties, WEB-INF or resources?

What are these properties? If they are messages used by Tapestry,  
app.properties. If not, resources.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org