You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by se...@apache.org on 2007/06/01 08:15:18 UTC

svn commit: r543399 - /jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/Turbine.java

Author: seade
Date: Thu May 31 23:15:17 2007
New Revision: 543399

URL: http://svn.apache.org/viewvc?view=rev&rev=543399
Log:
The error is now an info if default ServerData are defined.

Modified:
    jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/Turbine.java

Modified: jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/Turbine.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/Turbine.java?view=diff&rev=543399&r1=543398&r2=543399
==============================================================================
--- jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/Turbine.java (original)
+++ jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/Turbine.java Thu May 31 23:15:17 2007
@@ -555,19 +555,29 @@
      * Return all the Turbine Servlet information (Server Name, Port,
      * Scheme in a ServerData structure. This is generated from the
      * values set when initializing the Turbine and may not be correct
-     * if you're running in a clustered structure. This might be used
-     * if you need a DataURI and have no RunData object handy-
+     * if you're running in a clustered structure. You can provide default
+     * values in your configuration for cases where access is requied before
+     * your application is first accessed by a user.  This might be used
+     * if you need a DataURI and have no RunData object handy.
      *
      * @return An initialized ServerData object
      */
     public static ServerData getDefaultServerData()
     {
-        if(serverData == null)
+        if (serverData == null)
         {
-            log.error("ServerData Information requested from Turbine before first request!");
+            String serverName
+                    = configuration.getString(DEFAULT_SERVER_NAME_KEY);
+            if (serverName == null)
+            {
+                log.error("ServerData Information requested from Turbine before first request!");
+            }
+            else
+            {
+                log.info("ServerData Information retrieved from configuration.");
+            }
             // Will be overwritten once the first request is run;
-            serverData = new ServerData(
-                    configuration.getString(DEFAULT_SERVER_NAME_KEY),
+            serverData = new ServerData(serverName,
                     configuration.getInt(DEFAULT_SERVER_PORT_KEY,
                             URIConstants.HTTP_PORT),
                     configuration.getString(DEFAULT_SERVER_SCHEME_KEY,



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org