Tue, 03 Aug 2021 12:22:10 +0200
fixes response locale not set for new sessions
universe@204 | 1 | /* |
universe@204 | 2 | * Copyright 2021 Mike Becker. All rights reserved. |
universe@204 | 3 | * |
universe@204 | 4 | * Redistribution and use in source and binary forms, with or without |
universe@204 | 5 | * modification, are permitted provided that the following conditions are met: |
universe@204 | 6 | * |
universe@204 | 7 | * 1. Redistributions of source code must retain the above copyright |
universe@204 | 8 | * notice, this list of conditions and the following disclaimer. |
universe@204 | 9 | * |
universe@204 | 10 | * 2. Redistributions in binary form must reproduce the above copyright |
universe@204 | 11 | * notice, this list of conditions and the following disclaimer in the |
universe@204 | 12 | * documentation and/or other materials provided with the distribution. |
universe@204 | 13 | * |
universe@204 | 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
universe@204 | 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
universe@204 | 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
universe@204 | 17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
universe@204 | 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
universe@204 | 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
universe@204 | 20 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
universe@204 | 21 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
universe@204 | 22 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
universe@204 | 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
universe@204 | 24 | */ |
universe@204 | 25 | |
universe@204 | 26 | package de.uapcore.lightpit.servlet |
universe@204 | 27 | |
universe@204 | 28 | import de.uapcore.lightpit.AbstractServlet |
universe@204 | 29 | import de.uapcore.lightpit.HttpRequest |
universe@204 | 30 | import de.uapcore.lightpit.dao.DataAccessObject |
universe@204 | 31 | import javax.servlet.annotation.WebServlet |
universe@204 | 32 | |
universe@204 | 33 | @WebServlet(urlPatterns = ["/about/*"]) |
universe@204 | 34 | class AboutServlet : AbstractServlet() { |
universe@204 | 35 | |
universe@204 | 36 | init { |
universe@204 | 37 | get("/", this::viewAboutPage) |
universe@204 | 38 | } |
universe@204 | 39 | |
universe@204 | 40 | private fun viewAboutPage(http: HttpRequest, dao: DataAccessObject) { |
universe@204 | 41 | with(http) { |
universe@204 | 42 | styleSheets = listOf("about") |
universe@204 | 43 | render("about") |
universe@204 | 44 | } |
universe@204 | 45 | } |
universe@204 | 46 | } |