diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-07-08 13:32:23 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-07-08 13:32:23 +0200 |
commit | 3f9891a9198619568c82220b706a445217335065 (patch) | |
tree | f808621885827a38007460601ae32475ab7c1eea /id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java | |
parent | 206f283585a28009bb8276f78e7ea1d95298fd8c (diff) | |
parent | 4ebecf480d17550d93165ab17c249cd2caed9e5b (diff) | |
download | moa-id-spss-3f9891a9198619568c82220b706a445217335065.tar.gz moa-id-spss-3f9891a9198619568c82220b706a445217335065.tar.bz2 moa-id-spss-3f9891a9198619568c82220b706a445217335065.zip |
Merge PVP2 and MOA 2.0
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java index 2ff9e5210..db6d7aa53 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ServletUtils.java @@ -31,6 +31,7 @@ import java.io.IOException; import java.io.OutputStream; import java.net.URLEncoder; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import at.gv.egovernment.moa.id.MOAIDException; @@ -145,5 +146,17 @@ public class ServletUtils { Logger.debug("Finished POST " + servletName); } -
+ + public static String getBaseUrl( HttpServletRequest request ) { + if ( ( request.getServerPort() == 80 ) || + ( request.getServerPort() == 443 ) ) + return request.getScheme() + "://" + + request.getServerName() + + request.getContextPath(); + else + return request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + request.getContextPath(); + } +
}
|