diff -r 192298f8161f -r bb4c52bf3439 src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java --- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sat May 23 13:34:41 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sat May 23 13:52:04 2020 +0200 @@ -58,10 +58,6 @@ private static final String SITE_JSP = Functions.jspPath("site"); - /** - * The EL proxy is necessary, because the EL resolver cannot handle annotation properties. - */ - private LightPITModule.ELProxy moduleInfo = null; @FunctionalInterface protected interface SQLFindFunction { @@ -102,6 +98,12 @@ return (ModuleManager) getServletContext().getAttribute(ModuleManager.SC_ATTR_NAME); } + /** + * Returns the name of the resource bundle associated with this servlet. + * @return the resource bundle base name + */ + protected abstract String getResourceBundleName(); + /** * Creates a set of data access objects for the specified connection. @@ -150,12 +152,7 @@ @Override public void init() throws ServletException { - moduleInfo = Optional.ofNullable(this.getClass().getAnnotation(LightPITModule.class)) - .map(LightPITModule.ELProxy::new).orElse(null); - - if (moduleInfo != null) { - scanForRequestMappings(); - } + scanForRequestMappings(); LOG.trace("{} initialized", getServletName()); } @@ -387,7 +384,7 @@ final String fullPath = Functions.fullPath(req); req.setAttribute(Constants.REQ_ATTR_BASE_HREF, Functions.baseHref(req)); req.setAttribute(Constants.REQ_ATTR_PATH, fullPath); - Optional.ofNullable(moduleInfo).ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy)); + req.setAttribute(Constants.REQ_ATTR_RESOURCE_BUNDLE, getResourceBundleName()); // if this is an error path, bypass the normal flow if (fullPath.startsWith("/error/")) {