Richard, The problem I encountered is that Global object is already created by the framework before I have a chance to populate it with my division property from the .application. The Home page is instantiated before the createGlobal() inside my engine.
Is there a way to access the property from Global class directly instead? Thanks again. -----Original Message----- From: Hensley, Richard [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 12:19 PM To: Tapestry users Subject: RE: Access Property Defined in .application Patrick, Look into overriding the createGlobal() method in the engine and using a custom engine in your application. protected Object createGlobal(RequestContext arg0) { return Global.getGlobal(); } In order to use a custom engine, you must specify an engine-class as an attribute of your application element in your .application file. -----Original Message----- From: Patrick Yip [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 10:17 AM To: Tapestry users Subject: RE: Access Property Defined in .application Upon further reflection of my division design issue, instead of getting the division via the engines, I realize that it is even better to have the division stored in the Global object so that it can be shared by all sessions. How should I access the property in the .application via the Global object? I would initially think that I'll need to get it from the Global object's constructor when it is first created by the framework. Anyone has done this before? And what is the best way to do this? Many thanks, -----Original Message----- From: Patrick Yip Sent: Thursday, April 07, 2005 4:26 PM To: Tapestry users Subject: RE: Access Property Defined in .application Ok...I drilled down deeper into the API and found this to work: My .application has a custom property: <property name="division" value="1"/> In the engine I can now get the division from .application via this call: division = context.getServlet().getApplicationSpecification().getProperty("division "); Then just add the getter method and that's it. I like to post it here in case someone has a need for it. Tap! Tap! Tap! Patrick ^^ -----Original Message----- From: Patrick Yip Sent: Thursday, April 07, 2005 2:55 PM To: Tapestry users Subject: Access Property Defined in .application I have a need to define a startup property such as Division ID so that the same Tapestry application can be used for different divisions of the company. Then based on the division ID, the site dynamically display information based on the divisional settings in the database. How should I access the property from my Engine class which I extended from the Base class? Is the .application file the right place to store this type of global parameters? Many thanks, Patrick Yip Director of Software Development International Computer Graphics, Inc. 626-923-1133 ext.241 www.icg.com <http://www.icg.com/> --------------------------------------------------------------------- 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]
