If you're looking to find the name of the context directory, this
trick usually works:
Step 1: Override ApplicationServlet
Step 2: In your init method do:
public void init(ServletConfig config) throws ServletException {
super.init(config);
String temp = config.getServletContext().getRealPath("");
fRootDirectory = temp;
Log.debug("Context directory = " + fRootDirectory);
}
> -----Original Message-----
> From: John Coleman [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 02, 2005 8:50 AM
> To: Tapestry users
> Subject: Re: initializing services on startup
>
> I was almost going to ask this a while ago when I was getting into
> Cayenne.
>
> I was keen to find out the name of context directory do I could obtain
> resources in hivemind, as I was using javassist and would of liked to have
> stored ct classes in a temp directory under the context, and of located
> any
> resource off a root directory.
>
> In the end I was not storing the ct class as a file and just loaded it
> directly, and got resources by moving my class package and using the
> class.getRes' method. And I also concluded that really I should not be
> using
> anything weby in my services, as they are purely intended to do
> persistence
> and business logic, niether of which should be bound to the server.
>
> Sorry not to answer your q. Ron. I'd be interested to know why you have
> that
> requirement. And answer could also help me to.
>
> Maybe write something into your web.xml to load at start up and have that
> load your HM registry, or obtain it and pass in a reference?
>
> John
>
> ----- Original Message -----
> From: "Ron Piterman" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Friday, December 02, 2005 2:38 PM
> Subject: initializing services on startup
>
>
> > Hi,
> > how can i initialize a hivemind service on servlet startup ?
> > Cheers,
> > Ron
> >
> >
> > ---------------------------------------------------------------------
> > 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]