On Jan 27, 2006, at 5:33 PM, Colin Shreffler wrote:
In my wo application, I have a class that was created by the development environment (when the project was created) called Application.java.
This is the standard Application class provided by WO to allow you to override WOApplication, a singleton class whose single instance represents the application.
I am trying to add a start up routine to my application (to read information in a Properties file) and thought that the best place to put this would be in the constructor of this class.
It does not, however, appear to be working… the constructor doesn’t appear to get called. Is there a better way to add start up routines? In a different class perhaps?
This is the appropriate place to add initialization code if you're running a standard WO deployment. I haven't deployed outside that environment, but I seem to remember reading on the list that a WOApp is initialized slightly differently if deployed in a J2EE servlet container. In any case, it would help to know what your deployment environment is if you're having this kind of trouble.
I’m not sure if this is the class that is used to create the ‘actual’ application instance when the wo application starts up. It does also inherit from WOApplication.
As stated above, this is the class provided to you to customize (by inheritance) the WOApplication class which represents the application. Within any given WO application, this is a singleton class. You can run multiple WO instances on a server, but communicating between them requires going outside the bounds of the application.
Further more, when I try the following cast in my code it fails:
Application app = (Application) this.application();
The instanced referenced by this.application() also inherits from WOApplication. Why won’t this cast work?
I don't know why this should fail. Could you provide more information on how it fails?
Any help on this matter would be greatly appreciated.
Please post answers to these questions back to the mailing list for a wider audience to address further concerns, and so both current mailing list members and posterity can follow the thread if others have the same problems.