* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
*\r
* In addition, as a special exception, The Mir-coders gives permission to link\r
- * the code of this program with the com.oreilly.servlet library, any library\r
- * licensed under the Apache Software License, The Sun (tm) Java Advanced\r
- * Imaging library (JAI), The Sun JIMI library (or with modified versions of\r
- * the above that use the same license as the above), and distribute linked\r
- * combinations including the two. You must obey the GNU General Public\r
- * License in all respects for all of the code used other than the above\r
- * mentioned libraries. If you modify this file, you may extend this exception\r
- * to your version of the file, but you are not obligated to do so. If you do\r
- * not wish to do so, delete this exception statement from your version.\r
+ * the code of this program with any library licensed under the Apache Software License,\r
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library\r
+ * (or with modified versions of the above that use the same license as the above),\r
+ * and distribute linked combinations including the two. You must obey the\r
+ * GNU General Public License in all respects for all of the code used other than\r
+ * the above mentioned libraries. If you modify this file, you may extend this\r
+ * exception to your version of the file, but you are not obligated to do so.\r
+ * If you do not wish to do so, delete this exception statement from your version.\r
*/\r
\r
import java.io.IOException;\r
-import java.io.PrintWriter;\r
import java.lang.reflect.Method;\r
-import java.util.GregorianCalendar;\r
+import java.util.*;\r
import java.util.HashMap;\r
+import java.util.Iterator;\r
+import java.util.List;\r
import java.util.Locale;\r
-import java.util.*;\r
-\r
+import java.util.Map;\r
+import java.util.Vector;\r
+import javax.servlet.ServletConfig;\r
import javax.servlet.ServletException;\r
import javax.servlet.UnavailableException;\r
import javax.servlet.http.HttpServletRequest;\r
import javax.servlet.http.HttpServletResponse;\r
import javax.servlet.http.HttpSession;\r
\r
-import freemarker.template.*;\r
-\r
import org.apache.struts.util.MessageResources;\r
-\r
-import mir.misc.*;\r
-import mir.servlet.*;\r
-import mir.util.*;\r
-import mir.generator.*;\r
-//import mir.log.Log;\r
-\r
-import mircoders.global.*;\r
-import mircoders.localizer.*;\r
+import mir.config.MirPropertiesConfiguration;\r
+import mir.servlet.AbstractServlet;\r
+import mir.servlet.ServletModule;\r
+import mir.servlet.ServletModuleDispatch;\r
+import mir.servlet.ServletModuleExc;\r
+import mir.servlet.ServletModuleUserExc;\r
+import mir.util.ExceptionFunctions;\r
+import mir.util.StringRoutines;\r
import mircoders.entity.EntityUsers;\r
+import mircoders.global.MirGlobal;\r
import mircoders.module.ModuleMessage;\r
import mircoders.module.ModuleUsers;\r
-import mircoders.storage.DatabaseArticleType;\r
-import mircoders.storage.DatabaseMessages;\r
+import mircoders.servlet.ServletHelper;\r
import mircoders.storage.DatabaseUsers;\r
\r
+\r
+\r
+\r
/**\r
* Mir.java - main servlet, that dispatches to servletmodules\r
*\r
* @author $Author: zapata $\r
- * @version $Id: Mir.java,v 1.24 2002/12/17 19:20:31 zapata Exp $\r
+ * @version $Id: Mir.java,v 1.50 2003/09/03 18:29:01 zapata Exp $\r
*\r
*/\r
-\r
public class Mir extends AbstractServlet {\r
-\r
private static ModuleUsers usersModule = null;\r
private static ModuleMessage messageModule = null;\r
- private final static HashMap servletModuleInstanceHash = new HashMap();\r
+ private final static Map servletModuleInstanceHash = new HashMap();\r
+ private static Locale fallbackLocale = null;\r
\r
private static List loginLanguages = null;\r
\r
- public HttpSession session;\r
-\r
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws\r
- ServletException, IOException {\r
- doPost(req, res);\r
- }\r
-\r
- protected TemplateModel getLoginLanguages() throws ServletException {\r
+ protected List getLoginLanguages() throws ServletException {\r
synchronized (Mir.class) {\r
try {\r
-\r
if (loginLanguages == null) {\r
- MessageResources messageResources2 = MessageResources.\r
- getMessageResources("bundles.admin");\r
- MessageResources messageResources = MessageResources.\r
- getMessageResources("bundles.adminlocal");\r
- List languages = StringRoutines.splitString(MirGlobal.\r
- getConfigPropertyWithDefault("Mir.Login.Languages", "en"), ";");\r
+ MessageResources messageResources =\r
+ MessageResources.getMessageResources("bundles.adminlocal");\r
+ MessageResources messageResources2 =\r
+ MessageResources.getMessageResources("bundles.admin");\r
+\r
+ List languages =\r
+ StringRoutines.splitString(MirGlobal.config().getString("Mir.Login.Languages", "en"), ";");\r
\r
loginLanguages = new Vector();\r
+\r
Iterator i = languages.iterator();\r
\r
while (i.hasNext()) {\r
String code = (String) i.next();\r
Locale locale = new Locale(code, "");\r
String name = messageResources.getMessage(locale, "languagename");\r
- if (name == null)\r
+\r
+ if (name == null) {\r
name = messageResources2.getMessage(locale, "languagename");\r
- if (name == null)\r
+ }\r
+\r
+ if (name == null) {\r
name = code;\r
+ }\r
\r
Map record = new HashMap();\r
record.put("name", name);\r
}\r
}\r
\r
- return FreemarkerGenerator.makeAdapter(loginLanguages);\r
+ return loginLanguages;\r
}\r
catch (Throwable t) {\r
throw new ServletException(t.getMessage());\r
}\r
}\r
\r
- public void doPost(HttpServletRequest req, HttpServletResponse res) throws\r
- ServletException, IOException, UnavailableException {\r
+ public void init(ServletConfig config) throws ServletException {\r
+ super.init(config);\r
+\r
+ usersModule = new ModuleUsers(DatabaseUsers.getInstance());\r
+ }\r
\r
- long startTime = System.currentTimeMillis();\r
- long sessionConnectTime = 0;\r
- EntityUsers userEntity;\r
- String http = "";\r
+ protected String getDefaultLanguage(HttpServletRequest aRequest) {\r
+ String defaultlanguage =\r
+ MirGlobal.config().getString("Mir.Login.DefaultLanguage", "");\r
\r
- if (getServletContext().getAttribute("mir.confed") == null) {\r
- getConfig(req);\r
+ if (defaultlanguage.length() == 0) {\r
+ Locale locale = aRequest.getLocale();\r
+ defaultlanguage = locale.getLanguage();\r
}\r
\r
- MirConfig.setServletName(getServletName());\r
+ return defaultlanguage;\r
+ }\r
\r
- //*** test\r
- // Log.info(this, "blalalala");\r
+ protected synchronized Locale getFallbackLocale() throws ServletException {\r
+ try {\r
+ if (fallbackLocale == null) {\r
+ fallbackLocale = new Locale(MirPropertiesConfiguration.instance().getString("Mir.Admin.FallbackLanguage", "en"), "");\r
+ }\r
+ }\r
+ catch (Throwable t) {\r
+ throw new ServletException(t.getMessage());\r
+ }\r
\r
- session = req.getSession(true);\r
- userEntity = (EntityUsers) session.getAttribute("login.uid");\r
+ return fallbackLocale;\r
+ }\r
\r
- if (req.getServerPort() == 443)\r
- http = "https";\r
- else\r
- http = "http";\r
+ public EntityUsers checkCredentials(HttpServletRequest aRequest) throws ServletException {\r
+ try {\r
+ EntityUsers user = ServletHelper.getUser(aRequest);\r
\r
- //nothing in Mir can or should be cached as it's all dynamic...\r
- //\r
- //this needs to be done here and not per page (via meta tags) as some\r
- //browsers have problems w/ it per-page -mh\r
- res.setHeader("Pragma", "no-cache");\r
- res.setDateHeader("Expires", 0);\r
- res.setHeader("Cache-Control", "no-cache");\r
- res.setContentType("text/html; charset=" + MirConfig.getProp("Mir.DefaultEncoding"));\r
+ String username = aRequest.getParameter("login");\r
+ String password = aRequest.getParameter("password");\r
\r
- String moduleName = req.getParameter("module");\r
- checkLanguage(session, req);\r
+ if (username != null && password != null) {\r
+ user = usersModule.getUserForLogin(username, password);\r
\r
- /** @todo for cleanup and readability this should be moved to\r
- * method loginIfNecessary() */\r
\r
- if (moduleName != null && moduleName.equals("direct")) {\r
- //...\r
+ ServletHelper.setUser(aRequest, user);\r
+ }\r
+\r
+ return user;\r
+ }\r
+ catch (Throwable t) {\r
+ t.printStackTrace();\r
+\r
+ throw new ServletException(t.toString());\r
}\r
+ }\r
+\r
+ public void process(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException, UnavailableException {\r
+ try {\r
+ long startTime = System.currentTimeMillis();\r
+ long sessionConnectTime = 0;\r
+\r
+ HttpSession session = aRequest.getSession(true);\r
+ setNoCaching(aResponse);\r
+ Locale locale = new Locale(getDefaultLanguage(aRequest), "");\r
+ aResponse.setContentType("text/html; charset=" +\r
+ configuration.\r
+ getString("Mir.DefaultHTMLCharset", "UTF-8"));\r
+\r
+ EntityUsers userEntity = checkCredentials(aRequest);\r
\r
- // Authentication\r
- if ( (moduleName != null && moduleName.equals("login")) || (userEntity == null)) {\r
- String user = req.getParameter("login");\r
- String passwd = req.getParameter("password");\r
- theLog.printDebugInfo("--login: evaluating for user: " + user);\r
- userEntity = allowedUser(user, passwd);\r
if (userEntity == null) {\r
- // login failed: redirecting to login\r
- theLog.printWarning("--login: failed!");\r
- _sendLoginPage(res, req, res.getWriter());\r
- return;\r
+ String queryString = aRequest.getQueryString();\r
+\r
+ if ( (queryString != null) && (queryString.length() != 0) && session.getAttribute("login.target") == null &&\r
+ (aRequest.getParameter("module")==null ||\r
+ (!aRequest.getParameter("module").equals("login") && !aRequest.getParameter("module").equals("logout")))) {\r
+ session.setAttribute("login.target", queryString);\r
+ }\r
+\r
+ _sendLoginPage(aResponse, aRequest);\r
}\r
- else if (moduleName != null && moduleName.equals("login")) {\r
- // login successful\r
-\r
- theLog.printInfo("--login: successful! setting uid: " +\r
- userEntity.getId());\r
- session.setAttribute("login.uid", userEntity);\r
- theLog.printDebugInfo("--login: trying to retrieve login.target");\r
- String target = (String) session.getAttribute("login.target");\r
-\r
- if (target != null) {\r
- theLog.printDebugInfo("Redirect: " + target);\r
- int serverPort = req.getServerPort();\r
- String redirect = "";\r
- String redirectString = "";\r
-\r
- if (serverPort == 80) {\r
- redirect = res.encodeURL(http + "://" + req.getServerName() +\r
- target);\r
- redirectString =\r
- "<html><head><meta http-equiv=refresh content=\"1;URL="\r
- + redirect\r
- + "\"></head><body>going <a href=\"" + redirect +\r
- "\">Mir</a></body></html>";\r
+ else {\r
+ String moduleName = aRequest.getParameter("module");\r
+ checkLanguage(session, aRequest);\r
+\r
+ if ( ( (moduleName == null) || moduleName.equals(""))) {\r
+ moduleName="Admin";\r
+ }\r
+\r
+\r
+ if (moduleName.equals("login")) {\r
+ String target = (String) session.getAttribute("login.target");\r
+\r
+ if (target != null) {\r
+ ServletHelper.redirect(aResponse, target);\r
}\r
else {\r
- redirect = res.encodeURL(http + "://" + req.getServerName() + ":" +\r
- req.getServerPort() + target);\r
- redirectString =\r
- "<html><head><meta http-equiv=refresh content=\"1;URL="\r
- + redirect\r
- + "\"></head><body>going <a href=\"" + redirect +\r
- "\">Mir</a></body></html>";\r
+ ServletHelper.redirect(aResponse, "");\r
}\r
- res.getWriter().println(redirectString);\r
-\r
- //res.sendRedirect(redirect);\r
-\r
}\r
- else {\r
- // redirecting to default target\r
- theLog.printDebugInfo("--login: no target - redirecting to default");\r
- _sendStartPage(res, req, res.getWriter(), userEntity);\r
+ else if (moduleName.equals("logout")) {\r
+ logger.info(userEntity.getValue("login") + " has logged out");\r
+ session.invalidate();\r
+ _sendLoginPage(aResponse, aRequest);\r
+ return;\r
}\r
- return;\r
- } // if login succesful\r
- } // if login\r
-\r
- if (moduleName != null && moduleName.equals("logout")) {\r
- theLog.printDebugInfo("--logout");\r
- session.invalidate();\r
-\r
- //session = req.getSession(true);\r
- //checkLanguage(session, req);\r
- _sendLoginPage(res, req, res.getWriter());\r
- return;\r
- }\r
+ else {\r
+ try {\r
+ ServletModule servletModule = getServletModuleForName(moduleName);\r
+ ServletModuleDispatch.dispatch(servletModule, aRequest, aResponse);\r
\r
- // Check if authed!\r
- if (userEntity == null) {\r
- // redirect to loginpage\r
- String redirectString = req.getRequestURI();\r
- String queryString = req.getQueryString();\r
- if (queryString != null && !queryString.equals("")) {\r
- redirectString += "?" + req.getQueryString();\r
- theLog.printDebugInfo("STORING: " + redirectString);\r
- session.setAttribute("login.target", redirectString);\r
- }\r
- _sendLoginPage(res, req, res.getWriter());\r
- return;\r
- }\r
+ sessionConnectTime = System.currentTimeMillis() - startTime;\r
+ logger.info("EXECTIME (" + moduleName + "): " + sessionConnectTime + " ms");\r
+ }\r
+ catch (Throwable e) {\r
+ Throwable cause = ExceptionFunctions.traceCauseException(e);\r
\r
- // If no module is specified goto standard startpage\r
- if (moduleName == null || moduleName.equals("")) {\r
- theLog.printDebugInfo("no module: redirect to standardpage");\r
- _sendStartPage(res, req, res.getWriter(), userEntity);\r
- return;\r
- }\r
- // end of auth\r
+ if (cause instanceof ServletModuleUserExc)\r
+ handleUserError(aRequest, aResponse, (ServletModuleUserExc) cause);\r
+ else\r
+ handleError(aRequest, aResponse, cause);\r
+ }\r
\r
- // From now on regular dispatching...\r
- try {\r
- // get servletmodule by parameter and continue with dispacher\r
- ServletModule smod = getServletModuleForName(moduleName);\r
- ServletModuleDispatch.dispatch(smod, req, res);\r
- }\r
- catch (ServletModuleException e) {\r
- handleError(req, res, res.getWriter(),\r
- "ServletException in Module " + moduleName + " -- " +\r
- e.getMessage());\r
- }\r
- catch (ServletModuleUserException e) {\r
- handleUserError(req, res, res.getWriter(), e.getMessage());\r
+ if (aRequest.getParameter("killsession")!=null)\r
+ aRequest.getSession().invalidate();\r
+ }\r
+ }\r
}\r
+ catch (Throwable t) {\r
+ t.printStackTrace();\r
\r
- // timing...\r
- sessionConnectTime = System.currentTimeMillis() - startTime;\r
- theLog.printInfo("EXECTIME (" + moduleName + "): " + sessionConnectTime +\r
- " ms");\r
+ throw new ServletException(t.toString());\r
+ }\r
}\r
\r
/**\r
- * Private method getServletModuleForName returns ServletModule\r
- * from Cache\r
- *\r
- * @param moduleName\r
- * @return ServletModule\r
+ * caching routine to get a module for a module name\r
*\r
+ * @param moduleName the module name\r
+ * @return the requested module\r
+ * @throws ServletModuleExc\r
*/\r
- private static ServletModule getServletModuleForName(String moduleName) throws\r
- ServletModuleException {\r
\r
+ private static ServletModule getServletModuleForName(String moduleName) throws ServletModuleExc {\r
// Instance in Map ?\r
if (!servletModuleInstanceHash.containsKey(moduleName)) {\r
// was not found in hash...\r
try {\r
Class theServletModuleClass = null;\r
+\r
try {\r
// first we try to get ServletModule from stern.che3.servlet\r
- theServletModuleClass = Class.forName(\r
- "mircoders.servlet.ServletModule" + moduleName);\r
+ theServletModuleClass =\r
+ Class.forName("mircoders.servlet.ServletModule" + moduleName);\r
}\r
catch (ClassNotFoundException e) {\r
// on failure, we try to get it from lib-layer\r
- theServletModuleClass = Class.forName("mir.servlet.ServletModule" +\r
- moduleName);\r
+ theServletModuleClass =\r
+ Class.forName("mir.servlet.ServletModule" + moduleName);\r
}\r
+\r
Method m = theServletModuleClass.getMethod("getInstance", null);\r
ServletModule smod = (ServletModule) m.invoke(null, null);\r
+\r
// we put it into map for further reference\r
servletModuleInstanceHash.put(moduleName, smod);\r
+\r
return smod;\r
}\r
catch (Exception e) {\r
- throw new ServletModuleException("*** error resolving classname for " +\r
- moduleName + " -- " + e.getMessage());\r
+ throw new ServletModuleExc("*** error resolving classname for " + moduleName + " -- " + e.getMessage());\r
}\r
}\r
- else\r
+ else {\r
return (ServletModule) servletModuleInstanceHash.get(moduleName);\r
- }\r
-\r
- private void handleError(HttpServletRequest req, HttpServletResponse res,\r
- PrintWriter out, String errorString) {\r
-\r
- try {\r
- theLog.printError(errorString);\r
- SimpleHash modelRoot = new SimpleHash();\r
- modelRoot.put("errorstring", new SimpleScalar(errorString));\r
- modelRoot.put("date",\r
- new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));\r
- HTMLTemplateProcessor.process(res, MirConfig.getProp("Mir.ErrorTemplate"),\r
- modelRoot, out, getLocale(req));\r
- out.close();\r
- }\r
- catch (Exception e) {\r
- e.printStackTrace(System.out);\r
- System.err.println("Error in ErrorTemplate: " + e.getMessage());\r
}\r
}\r
\r
- private void handleUserError(HttpServletRequest req, HttpServletResponse res,\r
- PrintWriter out, String errorString) {\r
+ private void handleUserError(HttpServletRequest aRequest, HttpServletResponse aResponse, ServletModuleUserExc anException) {\r
try {\r
- theLog.printError(errorString);\r
- SimpleHash modelRoot = new SimpleHash();\r
- modelRoot.put("errorstring", new SimpleScalar(errorString));\r
- modelRoot.put("date",\r
- new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));\r
- HTMLTemplateProcessor.process(res,\r
- MirConfig.getProp("Mir.UserErrorTemplate"),\r
- modelRoot, out, getLocale(req));\r
- out.close();\r
- }\r
- catch (Exception e) {\r
- System.err.println("Error in UserErrorTemplate");\r
- }\r
+ logger.info("user error: " + anException.getMessage());\r
\r
- }\r
+ Map responseData = ServletHelper.makeGenerationData(aRequest, aResponse, new Locale[] {getLocale(aRequest), getFallbackLocale()});\r
\r
- /**\r
- * evaluate login for user / password\r
- */\r
- protected EntityUsers allowedUser(String user, String password) {\r
- try {\r
- if (usersModule == null)\r
- usersModule = new ModuleUsers(DatabaseUsers.getInstance());\r
- return usersModule.getUserForLogin(user, password);\r
+ MessageResources messages = MessageResources.getMessageResources("bundles.admin");\r
+ responseData.put("errorstring", messages.getMessage(getLocale(aRequest), anException.getMessage(), anException.getParameters()));\r
+ responseData.put("date", new GregorianCalendar().getTime());\r
+\r
+ ServletHelper.generateResponse(aResponse.getWriter(), responseData, MirPropertiesConfiguration.instance().getString("Mir.UserErrorTemplate"));\r
}\r
- catch (Exception e) {\r
- theLog.printDebugInfo(e.getMessage());\r
- e.printStackTrace();\r
- return null;\r
+ catch (Throwable e) {\r
+ logger.error("Error handling user error" + e.toString());\r
}\r
}\r
\r
- // Redirect-methods\r
- private void _sendLoginPage(HttpServletResponse res, HttpServletRequest req,\r
- PrintWriter out) {\r
- String loginTemplate = MirConfig.getProp("Mir.LoginTemplate");\r
- String sessionUrl = res.encodeURL("");\r
-\r
+ private void handleError(HttpServletRequest aRequest, HttpServletResponse aResponse, Throwable anException) {\r
try {\r
- SimpleHash mergeData = new SimpleHash();\r
- SimpleList languages = new SimpleList();\r
+ logger.error("error: " + anException);\r
\r
- mergeData.put("session", sessionUrl);\r
+ Map responseData = ServletHelper.makeGenerationData(aRequest, aResponse, new Locale[] {getLocale(aRequest), getFallbackLocale()});\r
\r
- mergeData.put("defaultlanguage", MirGlobal.getConfigPropertyWithDefault("Mir.Login.DefaultLanguage", "en"));\r
- mergeData.put("languages", getLoginLanguages());\r
+ responseData.put("errorstring", anException.toString());\r
+ responseData.put("date", new GregorianCalendar().getTime());\r
\r
- HTMLTemplateProcessor.process(res, loginTemplate, mergeData, out, getLocale(req));\r
+ ServletHelper.generateResponse(aResponse.getWriter(), responseData, MirPropertiesConfiguration.instance().getString("Mir.ErrorTemplate"));\r
}\r
catch (Throwable e) {\r
- handleError(req, res, out, "Error sending login page: " + e.getMessage());\r
+ logger.error("Error handling error: " + e.toString());\r
}\r
}\r
\r
- private void _sendStartPage(HttpServletResponse res, HttpServletRequest req,\r
- PrintWriter out, EntityUsers userEntity) {\r
- String startTemplate = "templates/admin/start_admin.template";\r
- String sessionUrl = res.encodeURL("");\r
+ // Redirect-methods\r
+ private void _sendLoginPage(HttpServletResponse aResponse, HttpServletRequest aRequest) {\r
+ String loginTemplate = configuration.getString("Mir.LoginTemplate");\r
\r
try {\r
- // merge with logged in user and messages\r
- SimpleHash mergeData = new SimpleHash();\r
- mergeData.put("session", sessionUrl);\r
- mergeData.put("login_user", userEntity);\r
- if (messageModule == null)\r
- messageModule = new ModuleMessage(DatabaseMessages.getInstance());\r
- mergeData.put("messages",\r
- messageModule.getByWhereClause(null, "webdb_create desc", 0,\r
- 10));\r
-\r
- mergeData.put("articletypes",\r
- DatabaseArticleType.getInstance().\r
- selectByWhereClause("", "id", 0, 20));\r
-\r
- HTMLTemplateProcessor.process(res, startTemplate, mergeData, out, getLocale(req));\r
+ Map responseData = ServletHelper.makeGenerationData(aRequest, aResponse, new Locale[] {getLocale(aRequest), getFallbackLocale()});\r
+\r
+ responseData.put("defaultlanguage", getDefaultLanguage(aRequest));\r
+ responseData.put("languages", getLoginLanguages());\r
+\r
+ ServletHelper.generateResponse(aResponse.getWriter(), responseData, loginTemplate);\r
}\r
- catch (Exception e) {\r
- e.printStackTrace(System.out);\r
- handleError(req, res, out, "error while trying to send startpage. " + e.getMessage());\r
+ catch (Throwable e) {\r
+ handleError(aRequest, aResponse, e);\r
}\r
}\r
\r
public String getServletInfo() {\r
- return "Mir " + MirConfig.getProp("Mir.Version");\r
- }\r
-\r
- private void checkLanguage(HttpSession session, HttpServletRequest req) {\r
- // a lang parameter always sets the language\r
- String lang = req.getParameter("language");\r
- if (lang != null) {\r
- theLog.printInfo("selected language " + lang + " overrides accept-language");\r
- setLanguage(session, lang);\r
- setLocale(session, new Locale(lang, ""));\r
- }\r
- // otherwise store language from accept header in session\r
- else if (session.getAttribute("Language") == null) {\r
- theLog.printInfo("accept-language is " + req.getLocale().getLanguage());\r
- setLanguage(session, req.getLocale().getLanguage());\r
- setLocale(session, req.getLocale());\r
- }\r
+ return "Mir " + configuration.getString("Mir.Version");\r
}\r
}\r