From f84f05273964bfbd85854088f3d860f650903f55 Mon Sep 17 00:00:00 2001 From: gregor Date: Fri, 15 Apr 2005 11:05:08 +0000 Subject: Initialisierungs-Property-Datei kann nun entweder aus dem Servlet-Kontext oder vom Dateisystem geladen werden. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@289 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/spss/slinterface/listeners/ContextListener.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/listeners') diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/listeners/ContextListener.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/listeners/ContextListener.java index 52de9c625..b865b2ee4 100644 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/listeners/ContextListener.java +++ b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/listeners/ContextListener.java @@ -5,6 +5,7 @@ */ package at.gv.egovernment.moa.spss.slinterface.listeners; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; @@ -72,7 +73,17 @@ public class ContextListener implements ServletContextListener // Load init properties try { + logger_.debug("Init properties location \"" + initPropsLoc + "\" will be used."); + + // Try to interpret init properties location as relative to the web application root InputStream initPropsIS = context.getResourceAsStream(initPropsLoc); + + if (initPropsIS == null) + { + // If this does not work, try to interpret init properties location as an absolute file system path + initPropsIS = new FileInputStream(initPropsLoc); + } + Properties initProps = new Properties(); initProps.load(initPropsIS); context.setAttribute(Constants.WSCP_INIT_PROPS_, initProps); -- cgit v1.2.3