[sword-svn] r259 - in trunk/webapp: . WEB-INF defines

scribe at crosswire.org scribe at crosswire.org
Mon Jul 10 13:21:53 MST 2006


Author: scribe
Date: 2006-07-10 13:21:52 -0700 (Mon, 10 Jul 2006)
New Revision: 259

Added:
   trunk/webapp/WEB-INF/swordweb.properties
Modified:
   trunk/webapp/defines/tiles.jsp
   trunk/webapp/init.jsp
Log:
Updated to allow relocation
Added support for a configuration file


Added: trunk/webapp/WEB-INF/swordweb.properties
===================================================================
--- trunk/webapp/WEB-INF/swordweb.properties	2006-07-10 00:40:12 UTC (rev 258)
+++ trunk/webapp/WEB-INF/swordweb.properties	2006-07-10 20:21:52 UTC (rev 259)
@@ -0,0 +1,2 @@
+orbexe=swordorbserver
+defaultBible=NASB

Modified: trunk/webapp/defines/tiles.jsp
===================================================================
--- trunk/webapp/defines/tiles.jsp	2006-07-10 00:40:12 UTC (rev 258)
+++ trunk/webapp/defines/tiles.jsp	2006-07-10 20:21:52 UTC (rev 259)
@@ -1,10 +1,10 @@
 <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
 
-<tiles:definition id="basic" page="/layouts/base-layout.jsp">
+<tiles:definition id="basic" page="layouts/base-layout.jsp">
 	<tiles:put name="lookup_url" value="passagestudy.jsp" />
 	<tiles:put name="title" value="OSIS web application" />
-	<tiles:put name="header" value="/tiles/header.jsp" />
-	<tiles:put name="footer" value="/tiles/footer.jsp" />
+	<tiles:put name="header" value="../tiles/header.jsp" />
+	<tiles:put name="footer" value="../tiles/footer.jsp" />
 	<tiles:put name="sidebar_right" value="" />
 	<tiles:put name="pintro" value="" />
 	<tiles:put name="sidebar_left" value="" />

Modified: trunk/webapp/init.jsp
===================================================================
--- trunk/webapp/init.jsp	2006-07-10 00:40:12 UTC (rev 258)
+++ trunk/webapp/init.jsp	2006-07-10 20:21:52 UTC (rev 259)
@@ -6,6 +6,9 @@
 <%@ page import="java.util.Vector" %>
 <%@ page import="java.util.Arrays" %>
 <%@ page import="java.util.Comparator" %>
+<%@ page import="java.util.Properties" %>
+<%@ page import="java.io.File" %>
+<%@ page import="java.io.FileInputStream" %>
 <%@ page import="org.crosswire.sword.orb.*" %>
 <%@ page import="java.net.URLEncoder" %>
 <%@ taglib uri="/WEB-INF/lib/crosswire-i18n.tld" prefix="t" %>
@@ -20,12 +23,24 @@
 	static Vector tabLinks = null;
 	static Vector tabTitles = null;
 	static Vector tabDefaults = null;
-	static String defaultBible = "NASB";
+	static String defaultBible = null;
+	static Properties swordWebConfig = null;
 %>
 
 <%
 	synchronized(this) {
 		if (styleNames == null) {
+			try {
+				swordWebConfig = new Properties();
+				File propName = new File(request.getSession().getServletContext().getRealPath("/WEB-INF/swordweb.properties"));
+				if (propName.exists()) {
+					FileInputStream propFile = new FileInputStream(propName);
+					swordWebConfig.load(propFile);
+					propFile.close();
+				}
+			}
+			catch (Exception e) { e.printStackTrace(); }
+			defaultBible = swordWebConfig.getProperty("defaultBible", "NASB");
 
 			styleNames = new Vector();
 			styleFiles = new Vector();



More information about the sword-cvs mailing list