@@ -0,0 +1,1084 @@
+package de.terrestris.shogun2.util.application;%0A%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0Aimport org.apache.http.client.utils.URIBuilder;%0Aimport org.springframework.stereotype.Component;%0A%0A/**%0A *%0A * @author Daniel Koch%0A *%0A */%0A@Component%0Apublic class Shogun2ServletContext %7B%0A%0A%09/**%0A%09 * Returns the full webapplication URI from a given request.%0A%09 *%0A%09 * Example:%0A%09 *%0A%09 * The following GET-request:%0A%09 *      http://localhost:8080/mapmavin/user/resetPassword.action%0A%09 * will result in%0A%09 *      http://localhost:8080/mapmavin/%0A%09 *%0A%09 * @param request%0A%09 * @return%0A%09 * @throws URISyntaxException%0A%09 */%0A%09public URI getApplicationURIFromRequest(HttpServletRequest request)%0A%09%09%09throws URISyntaxException %7B%0A%0A%09%09URI appURI = null;%0A%0A%09%09String scheme = request.getScheme();%0A%09%09String host = request.getServerName();%0A%09%09int port = request.getServerPort();%0A%09%09String path = request.getContextPath();%0A%0A%09%09appURI = new URIBuilder()%0A%09%09%09%09.setScheme(scheme)%0A%09%09%09%09.setHost(host)%0A%09%09%09%09.setPort(port)%0A%09%09%09%09.setPath(path)%0A%09%09%09%09.build();%0A%0A%09%09return appURI;%0A%09%7D%0A%0A%7D%0A

Add ServletContext util