small fixes yet again
[mir.git] / source / OpenMir.java
index 2ea1a6e..8190280 100755 (executable)
@@ -50,7 +50,8 @@ import mircoders.storage.*;
 /**
  *  OpenMir.java - main servlet for open posting and comment feature to articles
  *
- *  @author RK 1999-2001
+ *  @author RK 1999-2001, the mir-coders group
+ *  @version $Id: OpenMir.java,v 1.16 2002/12/06 08:12:42 mh Exp $
  *
  */
 
@@ -74,9 +75,12 @@ public class OpenMir extends AbstractServlet {
 
     // get the configration - this could conflict if 2 mirs are in the
     // VM maybe? to be checked. -mh
+    // -- they would have different servlet contexts, so the following is
+    // no problem (br1)
     if(getServletContext().getAttribute("mir.confed") == null) {
       getConfig(req);
     }
+      
     session = req.getSession();
 
     if(session.getAttribute("Language")==null){
@@ -91,17 +95,24 @@ public class OpenMir extends AbstractServlet {
     if (req.getParameter("language")!=null)
       setLocale(session, new Locale(req.getParameter("language"), "") );
 
+    //nothing in Mir can or should be cached as it's all dynamic...
+    //
+    //this needs to be done here and not per page (via meta tags) as some
+    //browsers have problems w/ it per-page -mh
+    res.setHeader("Pragma", "no-cache");
+    res.setDateHeader("Expires", 0);
+    res.setHeader("Cache-Control", "no-cache");
     res.setContentType("text/html; charset="
                       +MirConfig.getProp("Mir.DefaultEncoding"));
     try {
       ServletModuleDispatch.dispatch(ServletModuleOpenIndy.getInstance(),req,res);
     }
     catch (ServletModuleUserException e) {
-      handleUserError(req,res,res.getWriter(), e.getMsg());
+      handleUserError(req,res,res.getWriter(), e.getMessage());
     }
     catch (ServletModuleException e){
       e.printStackTrace();
-      handleError(req,res,res.getWriter(), "OpenIndy :: ServletException in Module ServletModule -- " + e.toString());
+      handleError(req,res,res.getWriter(), "OpenIndy :: ServletException in Module ServletModule -- " + e.getMessage());
     }
     // timing...
     sessionConnectTime = new java.util.Date().getTime() - startTime;
@@ -120,7 +131,7 @@ public class OpenMir extends AbstractServlet {
       out.close();
     }
     catch (Exception e) {
-      System.err.println("Fehler in UserErrorTemplate");
+      System.err.println("Error in UserErrorTemplate");
     }
 
   }
@@ -138,7 +149,7 @@ public class OpenMir extends AbstractServlet {
       out.close();
     }
     catch (Exception e) {
-      System.err.println("Fehler in ErrorTemplate");
+      System.err.println("Error in ErrorTemplate");
     }
 
   }