diff -r 94f174d591ab -r 59393c8cc557 src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt --- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Thu May 13 19:31:09 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Sat May 15 16:19:29 2021 +0200 @@ -80,16 +80,24 @@ request.setAttribute(Constants.REQ_ATTR_NAVIGATION, navigationMenu) } - var redirectLocation = "" + var redirectLocation: String? = null set(value) { field = value - request.setAttribute(Constants.REQ_ATTR_REDIRECT_LOCATION, baseHref + value) + if (value == null) { + request.removeAttribute(Constants.REQ_ATTR_REDIRECT_LOCATION) + } else { + request.setAttribute(Constants.REQ_ATTR_REDIRECT_LOCATION, baseHref + value) + } } - var feedPath = "" + var feedPath: String? = null set(value) { field = value - request.setAttribute(Constants.REQ_ATTR_FEED_HREF, baseHref + value) + if (value == null) { + request.removeAttribute(Constants.REQ_ATTR_FEED_HREF) + } else { + request.setAttribute(Constants.REQ_ATTR_FEED_HREF, baseHref + value) + } } /** @@ -116,10 +124,6 @@ */ val baseHref get() = "${request.scheme}://${request.serverName}$portInfo${request.contextPath}/" - init { - feedPath = "feed/projects.rss" - } - private fun String.withExt(ext: String) = if (endsWith(ext)) this else plus(ext) private fun jspPath(name: String) = Constants.JSP_PATH_PREFIX.plus(name).withExt(".jsp")