You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2009/05/19 17:49:54 UTC

svn commit: r776363 - /labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/cycle/WebCycling.aj

Author: simoneg
Date: Tue May 19 15:49:53 2009
New Revision: 776363

URL: http://svn.apache.org/viewvc?rev=776363&view=rev
Log:
LABS-363 : new web.context and web.serverurl properties to override default detection

Modified:
    labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/cycle/WebCycling.aj

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/cycle/WebCycling.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/cycle/WebCycling.aj?rev=776363&r1=776362&r2=776363&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/cycle/WebCycling.aj (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/cycle/WebCycling.aj Tue May 19 15:49:53 2009
@@ -6,6 +6,7 @@
 
 import org.apache.magma.basics.MagmaException;
 import org.apache.magma.basics.startup.Cycle;
+import org.apache.magma.settings.Settings;
 import org.apache.magma.website.Dispatch;
 import org.apache.magma.website.utils.URLRewritingStream;
 
@@ -24,17 +25,25 @@
 	before(HttpServletRequest req, HttpServletResponse resp) : servletStarting(req, resp) {
 		if (Cycle.get().isStarted()) return;
 		Cycle.start();
-		String mybaseurl = "";
-		String ctxpath = req.getContextPath(); 
-		if (ctxpath.length() > 0) {
-			mybaseurl += ctxpath;
+		String mybaseurl = Settings.get("web.context");
+		if (mybaseurl == null) {
+			mybaseurl = "";
+			String ctxpath = req.getContextPath(); 
+			if (ctxpath.length() > 0) {
+				mybaseurl += ctxpath;
+			}
+			String svltpath = req.getServletPath();
+			if (svltpath.length() > 0) {
+				mybaseurl += svltpath;
+			}
 		}
-		String svltpath = req.getServletPath();
-		if (svltpath.length() > 0) {
-			mybaseurl += svltpath;
+		
+		
+		String buff = Settings.get("web.serverurl");
+		if (buff == null) {
+			buff = req.getRequestURL().toString();			
 		}
 		
-		StringBuffer buff = req.getRequestURL();
 		String serverpart = null;
 		try {
 			URL url = new URL(buff.toString());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org