* Mir.java - main servlet, that dispatches to servletmodules
*
* @author $Author: mh $
- * @version $Revision: 1.17.2.3 $ $Date: 2002/12/06 07:14:45 $
+ * @version $Revision: 1.17.2.4 $ $Date: 2002/12/10 09:02:22 $
*
*/
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");
+ //make sure client browsers don't cache anything
+ setNoCaching(res);
+
res.setContentType("text/html; charset="
+MirConfig.getProp("Mir.DefaultEncoding"));
String moduleName = req.getParameter("module");
setLanguage(session,getAcceptLanguage(req));
}
- //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");
+ //make sure client browsers don't cache anything
+ setNoCaching(res);
+
res.setContentType("text/html; charset="
+MirConfig.getProp("Mir.DefaultEncoding"));
try {
import javax.servlet.UnavailableException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Locale;
import java.util.Random;
* Copyright: Copyright (c) 2001, 2002
* Company: Mir-coders group
* @author idfx, the Mir-coders group
- * @version $Id: AbstractServlet.java,v 1.15.4.4 2002/11/25 21:59:46 mh Exp $
+ * @version $Id: AbstractServlet.java,v 1.15.4.5 2002/12/10 09:02:22 mh Exp $
*/
public abstract class AbstractServlet extends HttpServlet {
protected static String lang;
protected static Logfile theLog;
+ protected void setNoCaching(HttpServletResponse res) {
+ //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");
+ }
+
/**
* the configration
*/
protected boolean getConfig(HttpServletRequest req)
throws UnavailableException {
- //String RealPath = super.getServletContext().getRealPath("/");
String name = super.getServletName();
// init config
- //MirConfig.initConfig(RealPath, RootUri, Name, getInitParameter("Config"));
MirConfig.initConfig(super.getServletContext(), req.getContextPath(),
name, getInitParameter("Config"));
protected String getAcceptLanguage(HttpServletRequest req) {
Locale loc = req.getLocale();
lang = loc.getLanguage();
- /* not needed anymore due to new i18n
- File f = new File(HTMLTemplateProcessor.templateDir+"/"+lang);
- //is there an existing template-path?
- if(!f.isDirectory()){
- //no there isn't. we use standard-language
- lang = MirConfig.getProp("StandardLanguage");
- theLog.printDebugInfo("language not existing");
- }
- theLog.printDebugInfo("Language: " + lang);
- */
return lang;
}
}