continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r442797 - /maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
Date Wed, 13 Sep 2006 02:22:36 GMT
Author: carlos
Date: Tue Sep 12 19:22:35 2006
New Revision: 442797

URL: http://svn.apache.org/viewvc?view=rev&rev=442797
Log:
Put a default value in baseUrl

Modified:
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java?view=diff&rev=442797&r1=442796&r2=442797
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
Tue Sep 12 19:22:35 2006
@@ -18,10 +18,14 @@
 
 import java.io.File;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.util.StringUtils;
 
+import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.xwork.Preparable;
 
 /**
@@ -59,6 +63,14 @@
 
         baseUrl = configuration.getUrl();
 
+        if ( StringUtils.isEmpty( baseUrl ) )
+        {
+            HttpServletRequest request = ServletActionContext.getRequest();
+            baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ "/"
+                + request.getContextPath();
+            getLogger().info( "baseUrl='" + baseUrl + "'" );
+        }
+
         companyLogo = configuration.getCompanyLogo();
 
         companyName = configuration.getCompanyName();
@@ -86,7 +98,7 @@
         configuration.setCompanyUrl( companyUrl );
 
         configuration.setInitialized( true );
-        configuration.store();            
+        configuration.store();
 
         return SUCCESS;
     }



Mime
View raw message