You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ausias vives <au...@yahoo.co.uk> on 2003/12/18 09:54:10 UTC

Init parameter in global object

Hello,

I need to use one init parameter to read an external
file (external to the web application) and share its
content through all the application. Ideally those
contents should be used to generate some parameters
and store them inside the global object.

I'm not sure if this is possible or is a good
approach.
Any body has done something similar?

Thanks

ausias

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

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


Re: Init parameter in global object

Posted by ausias vives <au...@yahoo.co.uk>.
I found that overriding the createGlobal method in
AbstractEngine allows me to initialize my Global
object with my own parameters and that solves my
problems cause I've got access to all properties
inside the engine.

Thanks for the tip about the getPropertySource()
method, it really usefull. Sometimes it's not easy to
find the thing you are looking for throughout the
handreds and handreds of classes and methods, though
for sure is somewhere else.


>
> I recommend looking into the property handling that
> Tapestry has.  You 
> can set a <property> in the .application file and
> access it from the 
> engine using
> getPropertySource().getPropertyValue("propName").
> 
> It is interesting to research where properties come
> from besides the 
> .application file too :)  (I'll leave that as an
> exercise for the 
> reader)

thank you teacher. ;-)

> 
> 	Erik
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>  

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

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


Re: Init parameter in global object

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Thursday, December 18, 2003, at 03:54  AM, ausias vives wrote:
> Hello,
>
> I need to use one init parameter to read an external
> file (external to the web application) and share its
> content through all the application. Ideally those
> contents should be used to generate some parameters
> and store them inside the global object.
>
> I'm not sure if this is possible or is a good
> approach.
> Any body has done something similar?

I recommend looking into the property handling that Tapestry has.  You 
can set a <property> in the .application file and access it from the 
engine using getPropertySource().getPropertyValue("propName").

It is interesting to research where properties come from besides the 
.application file too :)  (I'll leave that as an exercise for the 
reader)

	Erik


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