diff -r fd8c40ff78c3 -r 824d4042c857 src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java --- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sat May 09 15:19:21 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sat May 09 17:01:29 2020 +0200 @@ -1,8 +1,8 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * + * * Copyright 2018 Mike Becker. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -24,7 +24,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * + * */ package de.uapcore.lightpit; @@ -46,9 +46,9 @@ * the necessary functionality for {@link LightPITModule}s. */ public abstract class AbstractLightPITServlet extends HttpServlet { - + private static final Logger LOG = LoggerFactory.getLogger(AbstractLightPITServlet.class); - + private static final String HTML_FULL_DISPATCHER = Functions.jspPath("html_full"); /** @@ -66,14 +66,14 @@ private interface HandlerMethod { ResponseType apply(HttpServletRequest t, HttpServletResponse u) throws IOException; } - + /** * Invocation mapping gathered from the {@link RequestMapping} annotations. - * + *
* Paths in this map must always start with a leading slash, although * the specification in the annotation must not start with a leading slash. - * - * The reason for this is the different handling of empty paths in + *
+ * The reason for this is the different handling of empty paths in
* {@link HttpServletRequest#getPathInfo()}.
*/
private final Map
* It is sufficient to specify the name without any extension. The extension
* is added automatically if not specified.
- *
+ *
* The fragment must be located in the dynamic fragments folder.
- *
- * @param req the servlet request object
+ *
+ * @param req the servlet request object
* @param fragmentName the name of the fragment
* @see Constants#DYN_FRAGMENT_PATH_PREFIX
*/
public void setDynamicFragment(HttpServletRequest req, String fragmentName) {
req.setAttribute(Constants.REQ_ATTR_FRAGMENT, Functions.dynFragmentPath(fragmentName));
}
-
+
/**
* Specifies the name of an additional stylesheet used by the module.
- *
+ *
* Setting an additional stylesheet is optional, but quite common for HTML
* output.
- *
+ *
* It is sufficient to specify the name without any extension. The extension
* is added automatically if not specified.
- *
- * @param req the servlet request object
+ *
+ * @param req the servlet request object
* @param stylesheet the name of the stylesheet
*/
public void setStylesheet(HttpServletRequest req, String stylesheet) {
req.setAttribute(Constants.REQ_ATTR_STYLESHEET, Functions.enforceExt(stylesheet, ".css"));
}
-
+
private void forwardToFullView(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException {
-
+
req.setAttribute(Constants.REQ_ATTR_MENU, getModuleManager().getMainMenu(getDatabaseFacade()));
req.getRequestDispatcher(HTML_FULL_DISPATCHER).forward(req, resp);
}
-
+
private Optional