You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Erik Hatcher <li...@ehatchersolutions.com> on 2002/02/24 23:14:18 UTC

torque: ${webappRoot}

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/turbine-user@jakarta.apache.org/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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>