jvanzyl 01/11/15 15:09:36
Modified: src/java/org/apache/turbine Turbine.java
Log:
- have the logs produced in the webapp directory and not in the
application root, while developing and having the logs show
up in your dev directory isn't very good.
Revision Changes Path
1.8 +15 -5 jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java
Index: Turbine.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Turbine.java 2001/10/12 16:41:22 1.7
+++ Turbine.java 2001/11/15 23:09:36 1.8
@@ -109,7 +109,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sean Legassick</a>
- * @version $Id: Turbine.java,v 1.7 2001/10/12 16:41:22 jvanzyl Exp $
+ * @version $Id: Turbine.java,v 1.8 2001/11/15 23:09:36 jvanzyl Exp $
*/
public class Turbine
extends HttpServlet
@@ -151,6 +151,12 @@
private static String applicationRoot;
/**
+ * The webapp root where the Turbine application
+ * is running.
+ */
+ private static String webappRoot;
+
+ /**
* instance of turbine services
*/
private TurbineServices services =
@@ -203,11 +209,16 @@
applicationRoot = config.getServletContext().getRealPath("");
}
+ // Set the webapp root. The applicationRoot and the
+ // webappRoot will be the same when the application is
+ // deployed, but during development they may have
+ // different values.
+ webappRoot = config.getServletContext().getRealPath("");
+
// Create any directories that need to be setup for
// a running Turbine application.
createRuntimeDirectories();
-
// Initialize essential services (Resources & Logging)
services.initPrimaryServices(config);
@@ -216,8 +227,7 @@
// so that ${applicationRoot} and ${webappRoot} can be
// use in the TRP.
TurbineResources.setProperty(APPLICATION_ROOT, applicationRoot);
- TurbineResources.setProperty(WEBAPP_ROOT,
- config.getServletContext().getRealPath(""));
+ TurbineResources.setProperty(WEBAPP_ROOT, webappRoot);
// Initialize other services that require early init
services.initServices(config, false);
@@ -243,7 +253,7 @@
private static void createRuntimeDirectories()
{
// Create the logging directory
- File logDir = new File(getRealPath("/logs"));
+ File logDir = new File(webappRoot + "/logs");
if (logDir.exists() == false)
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>