# HG changeset patch # User Mike Becker # Date 1608303279 -3600 # Node ID a5b9632729b6cd980c7824736975b61ecb2f472e # Parent 2adc8623dd89ba5a22045c11bf8369e38e75f5be adds possibility to specify multiple additional CSS files diff -r 2adc8623dd89 -r a5b9632729b6 src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java --- 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. - *

- * Setting an additional stylesheet is optional, but quite common for HTML - * output. + * Specifies the names of additional stylesheets used by this Servlet. *

* 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())); } /** diff -r 2adc8623dd89 -r a5b9632729b6 src/main/webapp/WEB-INF/jsp/site.jsp --- a/src/main/webapp/WEB-INF/jsp/site.jsp Sat Dec 05 13:05:00 2020 +0100 +++ b/src/main/webapp/WEB-INF/jsp/site.jsp Fri Dec 18 15:54:39 2020 +0100 @@ -71,7 +71,9 @@ - + + +