Magnús ?ór Torfason wrote:
> > "Daniel L. Rall" wrote:
> > > There is no problem using Turbine services in a stand alone
> > > application (i.e. library fashion). There is one simple step of
> > > calling the properties/services initializer yourself.
> >
> > Yes, and no... It's easy to intialize resource service, but
> > initalizing the other services takes calling
> > TurbineServices.initServices(ServletConfig) to get the
> > getRealPath dependent methods to work. I needed that
> > for a command line application that used WebMacroService
> > (among others) so I had to come up with a fake ServletConfig
> > class that implemented getRealPath replacement that had
> > a list of paths to search. Not very clean, but it works for me.
> >
> > Rafal
> >
>
> Hmm, it seems to me that you are saying that it is impossible
> to set up the full service model without using your fake class.
>
> Would it be acceptable for you on one hand, and the community
> as a whole on the other to contribute this class and integrate it
> into Turbine.
I added org.apache.turbine.util.TurbineConfig class today.
Here's a snippet from my application:
try {
TurbineConfig config = new
TurbineConfig("./webapp","/WEB-INF/etc/Turbine.properties");
Turbine turbine = new Turbine();
turbine.init(config);
} catch(Exception e) {
error("Failed to intialize Turbine! ", e);
}
Enjoy!
Rafal
--
Rafal Krzewski
Senior Internet Developer
mailto:[EMAIL PROTECTED]
+48 22 8534830 http://e-point.pl
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]