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

changeset 195
9c7aff3cbb14
parent 184
e8eecee6aadf
child 198
94f174d591ab
equal deleted inserted replaced
194:2b3b7d0a885e 195:9c7aff3cbb14
106 private fun jspPath(name: String) = Constants.JSP_PATH_PREFIX.plus(name).withExt(".jsp") 106 private fun jspPath(name: String) = Constants.JSP_PATH_PREFIX.plus(name).withExt(".jsp")
107 107
108 fun param(name: String): String? = request.getParameter(name) 108 fun param(name: String): String? = request.getParameter(name)
109 fun paramArray(name: String): Array<String> = request.getParameterValues(name) ?: emptyArray() 109 fun paramArray(name: String): Array<String> = request.getParameterValues(name) ?: emptyArray()
110 110
111 fun forward(jsp: String) {
112 request.getRequestDispatcher(jspPath(jsp)).forward(request, response)
113 }
114
111 fun render(page: String? = null) { 115 fun render(page: String? = null) {
112 page?.let { contentPage = it } 116 page?.let { contentPage = it }
113 request.getRequestDispatcher(jspPath("site")).forward(request, response) 117 forward("site")
114 } 118 }
115 119
116 fun renderCommit(location: String? = null) { 120 fun renderCommit(location: String? = null) {
117 location?.let { redirectLocation = it } 121 location?.let { redirectLocation = it }
118 contentPage = Constants.JSP_COMMIT_SUCCESSFUL 122 contentPage = Constants.JSP_COMMIT_SUCCESSFUL

mercurial