db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Kucera <mkuc...@bbm.ca>
Subject RE: how to write a torque.init servlet
Date Fri, 07 Nov 2003 19:34:15 GMT

Here is a snippet from my web.xml. Listeners are defined before servlets.
Listeners are handy because they are automatically fired when the web-app is
deployed.


<!-- Listener is fired when the application is ready to start -->
<listener>
     <listener-class>ca.my.company.web.ContextListener</listener-class>
</listener>

Mike.

-----Original Message-----
From: Michael Bila [mailto:bilam@symbol.com] 
Sent: Friday, November 07, 2003 2:19 PM
To: torque-user@db.apache.org
Subject: RE: how to write a torque.init servlet


and do you add it to the web.xml? Sorry I'm new @ this.

>>> mkucera@bbm.ca 11/07/03 02:16PM >>>

I use a context listener to initialize torque. It looks something like the
following:


public final class ContextListener implements ServletContextListener {
    public void contextInitialized(ServletContextEvent event)
    {
        ServletContext context = event.getServletContext();
        String realPath = context.getRealPath("/");
        String torqueConfigFile = "/WEB-INF/Torque.properties";
        Torque.init(realPath + torqueConfigFile);
    }

    public void contextDestroyed(ServletContextEvent event)
    {
    }
}


-----Original Message-----
From: Michael Bila [mailto:bilam@symbol.com] 
Sent: Friday, November 07, 2003 12:31 PM
To: torque-user@db.apache.org 
Subject: how to write a torque.init servlet


does anyone have an example of a torque init servelt for postgress and
tomcat?

thanks



________________________________________________________________________
This email has been scanned for computer viruses.

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org 
For additional commands, e-mail: torque-user-help@db.apache.org 


________________________________________________________________________
This email has been scanned for computer viruses.


________________________________________________________________________
This email has been scanned for computer viruses.

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message