Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-06-10 07:56:37 +0000
committerEike Stepper2011-06-10 07:56:37 +0000
commitc9bcc68406a56be589443b9cfa665ca5bea57d50 (patch)
tree16064c2b5d25b30818260a3fd7a24780c8c93b17 /plugins/org.gastro.server.web
parente0af08333b1dacc6f2f0f22ee9eabdb62630348f (diff)
downloadcdo-c9bcc68406a56be589443b9cfa665ca5bea57d50.tar.gz
cdo-c9bcc68406a56be589443b9cfa665ca5bea57d50.tar.xz
cdo-c9bcc68406a56be589443b9cfa665ca5bea57d50.zip
fixed gastro servlet
Diffstat (limited to 'plugins/org.gastro.server.web')
-rw-r--r--plugins/org.gastro.server.web/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.gastro.server.web/src/org/gastro/server/internal/web/GastroServlet.java17
2 files changed, 13 insertions, 10 deletions
diff --git a/plugins/org.gastro.server.web/META-INF/MANIFEST.MF b/plugins/org.gastro.server.web/META-INF/MANIFEST.MF
index 8fadf3fde9..2cc19c0a96 100644
--- a/plugins/org.gastro.server.web/META-INF/MANIFEST.MF
+++ b/plugins/org.gastro.server.web/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CDO Gastro Example Server Web Support
Bundle-SymbolicName: org.gastro.server.web;singleton:=true
-Bundle-Version: 4.0.0.qualifier
+Bundle-Version: 4.0.100.qualifier
Bundle-Activator: org.gastro.server.internal.web.OM$Activator
Bundle-Vendor: Eclipse Modeling Project
Require-Bundle: org.apache.commons.logging;bundle-version="[1.1.0,2.0.0)",
@@ -21,5 +21,5 @@ Import-Package: javax.servlet;version="[2.3.0,3.0.0)",
org.apache.commons.lang;version="[2.3.0,3.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Export-Package: org.gastro.server.internal.web;version="4.0.0";x-internal:=true,
- templates;version="4.0.0";x-internal:=true
+Export-Package: org.gastro.server.internal.web;version="4.0.100";x-internal:=true,
+ templates;version="4.0.100";x-internal:=true
diff --git a/plugins/org.gastro.server.web/src/org/gastro/server/internal/web/GastroServlet.java b/plugins/org.gastro.server.web/src/org/gastro/server/internal/web/GastroServlet.java
index fe03ccf538..1423f12eb2 100644
--- a/plugins/org.gastro.server.web/src/org/gastro/server/internal/web/GastroServlet.java
+++ b/plugins/org.gastro.server.web/src/org/gastro/server/internal/web/GastroServlet.java
@@ -25,6 +25,7 @@ import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
import org.apache.commons.lang.StringEscapeUtils;
import org.gastro.business.BusinessDay;
@@ -38,7 +39,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
@@ -73,7 +73,7 @@ public class GastroServlet extends HttpServlet
@Override
public void init() throws ServletException
{
- System.out.println("INIT GastroServlet");
+ OM.LOG.info("Gastro servlet initializing");
String repositoryName = GastroServer.getRepository().getName();
restaurantName = getRestaurantName();
@@ -87,12 +87,13 @@ public class GastroServlet extends HttpServlet
CDOSession session = config.openSession();
view = session.openView();
super.init();
+ OM.LOG.info("Gastro servlet initialized");
}
@Override
public void destroy()
{
- System.out.println("DESTROY GastroServlet");
+ OM.LOG.info("Gastro servlet destroying");
if (view != null)
{
CDOSession session = (CDOSession)view.getSession();
@@ -113,6 +114,7 @@ public class GastroServlet extends HttpServlet
}
super.destroy();
+ OM.LOG.info("Gastro servlet destroyed");
}
public synchronized MenuCard getMenuCard()
@@ -155,18 +157,19 @@ public class GastroServlet extends HttpServlet
{
try
{
- String configName = System.getProperty("servlet.config", "gastro.properties");
- InputStream fis = new FileInputStream(configName);
+ String configPath = OMPlatform.INSTANCE.getProperty("servlet.config", "config/gastro.properties");
+ // InputStream stream = new FileInputStream(configPath);
+ InputStream stream = OM.BUNDLE.getInputStream(configPath);
try
{
Properties properties = new Properties();
- properties.load(fis);
+ properties.load(stream);
return properties.getProperty("restaurant");
}
finally
{
- fis.close();
+ stream.close();
}
}
catch (IOException ex)

Back to the top