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

changeset 205
7725a79416f3
parent 199
59393c8cc557
child 207
479dd7993ef9
equal deleted inserted replaced
204:54c612612c69 205:7725a79416f3
26 package de.uapcore.lightpit 26 package de.uapcore.lightpit
27 27
28 import de.uapcore.lightpit.dao.DataAccessObject 28 import de.uapcore.lightpit.dao.DataAccessObject
29 import de.uapcore.lightpit.viewmodel.NavMenu 29 import de.uapcore.lightpit.viewmodel.NavMenu
30 import de.uapcore.lightpit.viewmodel.View 30 import de.uapcore.lightpit.viewmodel.View
31 import java.util.*
31 import javax.servlet.http.HttpServletRequest 32 import javax.servlet.http.HttpServletRequest
32 import javax.servlet.http.HttpServletResponse 33 import javax.servlet.http.HttpServletResponse
33 import javax.servlet.http.HttpSession 34 import javax.servlet.http.HttpSession
34 import kotlin.math.min 35 import kotlin.math.min
35 36
55 field = value 56 field = value
56 request.setAttribute(Constants.REQ_ATTR_CONTENT_PAGE, jspPath(value)) 57 request.setAttribute(Constants.REQ_ATTR_CONTENT_PAGE, jspPath(value))
57 } 58 }
58 59
59 /** 60 /**
61 * The name of the content page.
62 *
63 * @see Constants#REQ_ATTR_CONTENT_PAGE
64 */
65 var pageTitle = ""
66 set(value) {
67 field = value
68 request.setAttribute(Constants.REQ_ATTR_PAGE_TITLE, value)
69 }
70
71 /**
60 * A list of additional style sheets. 72 * A list of additional style sheets.
61 * 73 *
62 * @see Constants#REQ_ATTR_STYLESHEET 74 * @see Constants#REQ_ATTR_STYLESHEET
63 */ 75 */
64 var styleSheets = emptyList<String>() 76 var styleSheets = emptyList<String>()
147 fun renderCommit(location: String? = null) { 159 fun renderCommit(location: String? = null) {
148 location?.let { redirectLocation = it } 160 location?.let { redirectLocation = it }
149 contentPage = Constants.JSP_COMMIT_SUCCESSFUL 161 contentPage = Constants.JSP_COMMIT_SUCCESSFUL
150 render() 162 render()
151 } 163 }
164
165 fun i18n(key: String) = ResourceBundle.getBundle("localization/strings", response.locale).getString(key)
152 } 166 }
153 167
154 /** 168 /**
155 * A path pattern optionally containing placeholders. 169 * A path pattern optionally containing placeholders.
156 * 170 *

mercurial