src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt

changeset 205
7725a79416f3
parent 199
59393c8cc557
child 207
479dd7993ef9
--- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Sun Aug 01 18:14:36 2021 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Sun Aug 01 18:56:28 2021 +0200
@@ -28,6 +28,7 @@
 import de.uapcore.lightpit.dao.DataAccessObject
 import de.uapcore.lightpit.viewmodel.NavMenu
 import de.uapcore.lightpit.viewmodel.View
+import java.util.*
 import javax.servlet.http.HttpServletRequest
 import javax.servlet.http.HttpServletResponse
 import javax.servlet.http.HttpSession
@@ -57,6 +58,17 @@
         }
 
     /**
+     * The name of the content page.
+     *
+     * @see Constants#REQ_ATTR_CONTENT_PAGE
+     */
+    var pageTitle = ""
+        set(value) {
+            field = value
+            request.setAttribute(Constants.REQ_ATTR_PAGE_TITLE, value)
+        }
+
+    /**
      * A list of additional style sheets.
      *
      * @see Constants#REQ_ATTR_STYLESHEET
@@ -149,6 +161,8 @@
         contentPage = Constants.JSP_COMMIT_SUCCESSFUL
         render()
     }
+
+    fun i18n(key: String) = ResourceBundle.getBundle("localization/strings", response.locale).getString(key)
 }
 
 /**

mercurial