I saw a message in the archives that says you can use ${webappRoot} in the
JDBC URL to have it map to an absolute path at runtime for hsqldb.
<http://www.mail-archive.com/[email protected]/msg03720.html>

This did not work for me, and I don't see any strings "webappRoot" in the
Torque codebase.  Am I missing something?  Or is this feature no longer
available?  I hacked it this way though:

            Configuration c = (Configuration)new
PropertiesConfiguration(getServletContext().getRealPath("/WEB-INF/torque.pro
perties"));
            String url =
(String)c.getProperty("torque.database.default.url");
            int start = url.indexOf("$");
            int finish = url.indexOf("}") + 1;
            url = url.substring(0,start) +
getServletContext().getRealPath("/") + url.substring(finish);
            c.setProperty("torque.database.default.url", url);
            Torque.init(c);

Of course this is a quick and dirty thing, but it works for me.

    Erik



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to