/*
- * Copyright (C) 2001, 2002 The Mir-coders group
+ * Copyright (C) 2001, 2002 The Mir-coders group
*
* This file is part of Mir.
*
/**
* Mir.java - main servlet, that dispatches to servletmodules
*
- * @author $Author: bruno $
- * @version $Revision: 1.20 $ $Date: 2002/10/09 16:09:05 $
- *
- * $Log: Mir.java,v $
- * Revision 1.20 2002/10/09 16:09:05 bruno
- * contains only admin templates which should not be changed by users
- *
- * Revision 1.19 2002/09/01 22:05:47 mh
- * Mir goes GPL
- *
- * Revision 1.18 2002/08/25 19:00:06 mh
- * merge of localization branch into HEAD. mh and zap
- *
- * Revision 1.17 2002/07/21 22:27:39 mh
- * make the user error msg look nicer
+ * @author $Author: mh $
+ * @version $Id: Mir.java,v 1.23 2002/12/06 08:12:42 mh Exp $
*
*/
EntityUsers userEntity;
String http = "";
- // get the configration - this could conflict if 2 mirs are in the
- // VM maybe? to be checked. -mh
if (getServletContext().getAttribute("mir.confed") == null) {
getConfig(req);
}
+
MirConfig.setServletName(getServletName());
//*** test
userEntity = (EntityUsers) session.getAttribute("login.uid");
if (req.getServerPort() == 443) http = "https"; else http = "http";
+
+ //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"));
String moduleName = req.getParameter("module");
}
catch (ServletModuleException e) {
handleError(req, res, res.getWriter(),
- "ServletException in Module " + moduleName + " -- " + e.toString());
+ "ServletException in Module " + moduleName + " -- " + e.getMessage());
}
catch (ServletModuleUserException e) {
- handleUserError(req, res, res.getWriter(), e.getMsg());
+ handleUserError(req, res, res.getWriter(), e.getMessage());
}
// timing...
}
catch (Exception e) {
throw new ServletModuleException("*** error resolving classname for " +
- moduleName + " -- " + e.toString());
+ moduleName + " -- " + e.getMessage());
}
}
else
out.close();
}
catch (Exception e) {
- System.err.println("Error in ErrorTemplate");
+ e.printStackTrace(System.out);
+ System.err.println("Error in ErrorTemplate: " + e.getMessage());
}
}
out.close();
}
catch (Exception e) {
- System.err.println("Fehler in UserErrorTemplate");
+ System.err.println("Error in UserErrorTemplate");
}
}
return usersModule.getUserForLogin(user, password);
}
catch (Exception e) {
- theLog.printDebugInfo(e.toString());
+ theLog.printDebugInfo(e.getMessage());
e.printStackTrace();
return null;
}
mergeData.put("articletypes", DatabaseArticleType.getInstance().selectByWhereClause("", "id", 0, 20));
+/*
SimpleList producersData = new SimpleList();
Iterator i = MirGlobal.localizer().producers().factories().entrySet().iterator();
while (i.hasNext()) {
producersData.add(producerData);
}
mergeData.put("producers", producersData);
-
+ */
HTMLTemplateProcessor.process(res, startTemplate, mergeData, out, getLocale(req));
}
catch (Exception e) {
e.printStackTrace(System.out);
- handleError(req, res, out, "error while trying to send startpage. " + e.toString());
+ handleError(req, res, out, "error while trying to send startpage. " + e.getMessage());
}
}