src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java

changeset 163
a5b9632729b6
parent 160
e2d09cf3fb96
child 167
3f30adba1c63
--- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java	Sat Dec 05 13:05:00 2020 +0100
+++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java	Fri Dec 18 15:54:39 2020 +0100
@@ -44,6 +44,7 @@
 import java.sql.SQLException;
 import java.util.*;
 import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * A special implementation of a HTTPServlet which is focused on implementing
@@ -265,19 +266,19 @@
     }
 
     /**
-     * Specifies the name of an additional stylesheet used by the module.
-     * <p>
-     * Setting an additional stylesheet is optional, but quite common for HTML
-     * output.
+     * Specifies the names of additional stylesheets used by this Servlet.
      * <p>
      * 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 stylesheet the name of the stylesheet
+     * @param req         the servlet request object
+     * @param stylesheets the names of the stylesheets
      */
-    public void setStylesheet(HttpServletRequest req, String stylesheet) {
-        req.setAttribute(Constants.REQ_ATTR_STYLESHEET, enforceExt(stylesheet, ".css"));
+    public void setStylesheet(HttpServletRequest req, String ... stylesheets) {
+        req.setAttribute(Constants.REQ_ATTR_STYLESHEET, Arrays
+                .stream(stylesheets)
+                .map(s -> enforceExt(s, ".css"))
+                .collect(Collectors.toUnmodifiableList()));
     }
 
     /**

mercurial