Hi Branko,
ideally you will not need to write any Java code at all to make it work.
Take a look at web.xml file shipped with Cayenne web-app tutorial:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cayenne/cayenne/doc/tutorial/
cayenne-web-app/WEB-INF/web.xml?rev=HEAD&content-type=text/vnd.viewcvs-marku
p
Lines of interest are :
<!-- Configure ServletConfiguration to listen for container events. -->
<listener>
<listener-class>test.CustomConfiguration</listener-class>
</listener>
The tutorial uses custom configuraton subclass, to use the standard one,
modify it like this:
<listener>
<listener-class>org.objectstyle.cayenne.conf.ServletConfiguration</listener-
class>
</listener>
For a more lengthy discussion on that see
http://objectstyle.org/cayenne/userguide/appguide/deploy.html#web
Andrus
Branko Kannenberg writes:
> Hi there !
>
> This is a newbie question, but I couldn't find an answer in the docs:
>
> I want to use a ServletConfiguration Object because my application runs under
> tomcat4.0.4.
> I would like to place cayenne.xml and the referenced driverinfo.xml into the
> WEB-INF directory.
>
> How do I initialize the Configuration so that those files are found?
>
> I used
> Configuration cayennenconf = new ServletConfiguration();
>
> and also
> Configuration.initSharedConfig(new ServletConfiguration());
> Configuration cayenneconf = Configuration.getSharedConfig();
>
> but that didn't work.
>
> Thanks in advance for any hints.
>
> Ciao, Branko.
>
>
This archive was generated by hypermail 2.0.0 : Fri Aug 30 2002 - 11:02:42 EDT