the fix for poolman and OID (Postgres Large Objects). a hack until real BLOBS.
[mir.git] / source / OpenMir.java
index 4b1d178..2002b9f 100755 (executable)
@@ -56,6 +56,9 @@ public class OpenMir extends AbstractServlet {
     try {
       ServletModuleDispatch.dispatch(ServletModuleOpenIndy.getInstance(),req,res);
     }
+    catch (ServletModuleUserException e) {
+      handleUserError(res,res.getWriter(), e.getMsg());  
+    }
     catch (ServletModuleException e){
       e.printStackTrace();
       handleError(res,res.getWriter(), "OpenIndy :: ServletException in Module ServletModule -- " + e.toString());
@@ -65,6 +68,22 @@ public class OpenMir extends AbstractServlet {
     theLog.printInfo("EXECTIME (ServletModuleOpenIndy): " + sessionConnectTime + " ms");
   }
 
+  private void handleUserError(HttpServletResponse res,PrintWriter out, String errorString) {
+
+    try {
+      theLog.printError(errorString);
+      SimpleHash modelRoot = new SimpleHash();
+      modelRoot.put("errorstring", new SimpleScalar(errorString));
+      modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));
+      HTMLTemplateProcessor.process(res,MirConfig.getProp("Mir.UserErrorTemplate"),modelRoot,out);
+      out.close();
+    }
+    catch (Exception e) {
+      System.err.println("Fehler in UserErrorTemplate");
+    }
+
+  }
+
   private void handleError(HttpServletResponse res,PrintWriter out, String errorString) {
 
     try {
@@ -72,7 +91,7 @@ public class OpenMir extends AbstractServlet {
       SimpleHash modelRoot = new SimpleHash();
       modelRoot.put("errorstring", new SimpleScalar(errorString));
       modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));
-      HTMLTemplateProcessor.process(res,Configuration.getProperty("Mir.ErrorTemplate"),modelRoot,out);
+      HTMLTemplateProcessor.process(res,MirConfig.getProp("Mir.ErrorTemplate"),modelRoot,out);
       out.close();
     }
     catch (Exception e) {