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

changeset 205
7725a79416f3
parent 199
59393c8cc557
child 207
479dd7993ef9
     1.1 --- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Sun Aug 01 18:14:36 2021 +0200
     1.2 +++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Sun Aug 01 18:56:28 2021 +0200
     1.3 @@ -28,6 +28,7 @@
     1.4  import de.uapcore.lightpit.dao.DataAccessObject
     1.5  import de.uapcore.lightpit.viewmodel.NavMenu
     1.6  import de.uapcore.lightpit.viewmodel.View
     1.7 +import java.util.*
     1.8  import javax.servlet.http.HttpServletRequest
     1.9  import javax.servlet.http.HttpServletResponse
    1.10  import javax.servlet.http.HttpSession
    1.11 @@ -57,6 +58,17 @@
    1.12          }
    1.13  
    1.14      /**
    1.15 +     * The name of the content page.
    1.16 +     *
    1.17 +     * @see Constants#REQ_ATTR_CONTENT_PAGE
    1.18 +     */
    1.19 +    var pageTitle = ""
    1.20 +        set(value) {
    1.21 +            field = value
    1.22 +            request.setAttribute(Constants.REQ_ATTR_PAGE_TITLE, value)
    1.23 +        }
    1.24 +
    1.25 +    /**
    1.26       * A list of additional style sheets.
    1.27       *
    1.28       * @see Constants#REQ_ATTR_STYLESHEET
    1.29 @@ -149,6 +161,8 @@
    1.30          contentPage = Constants.JSP_COMMIT_SUCCESSFUL
    1.31          render()
    1.32      }
    1.33 +
    1.34 +    fun i18n(key: String) = ResourceBundle.getBundle("localization/strings", response.locale).getString(key)
    1.35  }
    1.36  
    1.37  /**

mercurial