|
From: <ian...@us...> - 2007-11-09 01:53:23
|
Revision: 567
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=567&view=rev
Author: iansmith
Date: 2007-11-08 17:53:26 -0800 (Thu, 08 Nov 2007)
Log Message:
-----------
Fixed the stupid thing where URLs in the server.xml had to end in /.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-11-09 00:10:49 UTC (rev 566)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-11-09 01:53:26 UTC (rev 567)
@@ -76,6 +76,10 @@
initContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
baseUrl = (String) envCtx.lookup(OGOGLIO_BASE_URL_KEY);
+ if (!baseUrl.endsWith("/")) {
+ baseUrl=baseUrl+"/";
+ Log.warn(OGOGLIO_BASE_URL_KEY+" in server.xml should end in / but we're patching it:"+baseUrl);
+ }
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-11-09 00:10:49 UTC (rev 566)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-11-09 01:53:26 UTC (rev 567)
@@ -64,6 +64,8 @@
import com.ogoglio.xml.server.DocumentFactory;
public class SimServlet extends OgoglioServletBase {
+ private static final String OGOGLIO_BASE_SIM_URL_KEY = "ogoglio/baseSimURL";
+
private static final String RELOAD_PARAMETER = "reload";
public static final String THING_SERVICE_PATH_ELEMENT = "service";
@@ -91,7 +93,12 @@
//don't bother with the sim if nobody wants it
if (servletNeeded) {
- simURI = new URI((String) envCtx.lookup("ogoglio/baseSimURL"));
+ String tmpSimUrl=(String) envCtx.lookup(OGOGLIO_BASE_SIM_URL_KEY);
+ if (!tmpSimUrl.endsWith("/")) {
+ tmpSimUrl=tmpSimUrl+"/";
+ Log.warn(OGOGLIO_BASE_SIM_URL_KEY+" in server.xml should end in / but we are patching it:"+tmpSimUrl);
+ }
+ simURI = new URI(tmpSimUrl);
SimRecord simRecord = SimPersistTasks.findSimsBySimURI(simURI, getSessionFactory());
if (simRecord != null) {
//error
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|