diff options
-rw-r--r-- | doc/PDFAS4_WebDokumentation.docx | bin | 134602 -> 134755 bytes | |||
-rw-r--r-- | doc/PDFAS4_WebDokumentation.pdf | bin | 431062 -> 434616 bytes | |||
-rw-r--r-- | pdf-as-web/src/main/configuration/pdf-as-web.properties | 1 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java | 5 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 56 |
5 files changed, 39 insertions, 23 deletions
diff --git a/doc/PDFAS4_WebDokumentation.docx b/doc/PDFAS4_WebDokumentation.docx Binary files differindex b8d6fbf0..0e7b21ba 100644 --- a/doc/PDFAS4_WebDokumentation.docx +++ b/doc/PDFAS4_WebDokumentation.docx diff --git a/doc/PDFAS4_WebDokumentation.pdf b/doc/PDFAS4_WebDokumentation.pdf Binary files differindex 77bde6d9..a75ad5da 100644 --- a/doc/PDFAS4_WebDokumentation.pdf +++ b/doc/PDFAS4_WebDokumentation.pdf diff --git a/pdf-as-web/src/main/configuration/pdf-as-web.properties b/pdf-as-web/src/main/configuration/pdf-as-web.properties index 556fd667..fe6c9576 100644 --- a/pdf-as-web/src/main/configuration/pdf-as-web.properties +++ b/pdf-as-web/src/main/configuration/pdf-as-web.properties @@ -51,6 +51,7 @@ whitelist.enabled=true whitelist.url.01=^.*$ public.url=http://localhost:8080/pdf-as-web +#public.data.url=http://localhost:8088/pdf-as-web #Request Store # Default In Memory Store diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java index 1fffb17d..81b60131 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java @@ -39,6 +39,7 @@ import at.gv.egiz.pdfas.web.helper.PdfAsHelper; public class WebConfiguration implements IConfigurationConstants { public static final String PUBLIC_URL = "public.url"; + public static final String PUBLIC_DATA_URL = "public.data.url"; public static final String LOCAL_BKU_ENABLED = "bku.sign.enabled"; public static final String ONLINE_BKU_ENABLED = "moc.sign.enabled"; public static final String MOBILE_BKU_ENABLED = "mobile.sign.enabled"; @@ -226,6 +227,10 @@ public class WebConfiguration implements IConfigurationConstants { return properties.getProperty(PUBLIC_URL); } + public static String getPublicDataURL() { + return properties.getProperty(PUBLIC_DATA_URL); + } + public static String getLocalBKUURL() { if(getLocalBKUEnabled()) { String overwrite = properties.getProperty(CONFIG_BKU_URL); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index 8b98a322..9900dda4 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -1363,29 +1363,35 @@ public class PdfAsHelper { private static String generateURL(HttpServletRequest request, HttpServletResponse response, String Servlet) { - HttpSession session = request.getSession(); - String publicURL = WebConfiguration.getPublicURL(); - String dataURL = null; - if (publicURL != null) { - dataURL = publicURL + Servlet + ";jsessionid=" + session.getId(); - } else { - if ((request.getScheme().equals("http") && request.getServerPort() == 80) - || (request.getScheme().equals("https") && request - .getServerPort() == 443)) { - dataURL = request.getScheme() + "://" + request.getServerName() - + request.getContextPath() + Servlet + ";jsessionid=" - + session.getId(); - } else { - dataURL = request.getScheme() + "://" + request.getServerName() - + ":" + request.getServerPort() - + request.getContextPath() + Servlet + ";jsessionid=" - + session.getId(); - } - } - log.debug("Generated URL: " + dataURL); - return dataURL; + return generateURL(request, response, Servlet, WebConfiguration.getPublicURL()); + } + private static String generateURL(HttpServletRequest request, + HttpServletResponse response, String Servlet, String publicURL) { + HttpSession session = request.getSession(); + String dataURL = null; + if (publicURL != null) { + dataURL = publicURL + Servlet + ";jsessionid=" + session.getId(); + } else { + if ((request.getScheme().equals("http") && request.getServerPort() == 80) + || (request.getScheme().equals("https") && request + .getServerPort() == 443)) { + dataURL = request.getScheme() + "://" + request.getServerName() + + request.getContextPath() + Servlet + ";jsessionid=" + + session.getId(); + } else { + dataURL = request.getScheme() + "://" + request.getServerName() + + ":" + request.getServerPort() + + request.getContextPath() + Servlet + ";jsessionid=" + + session.getId(); + } + } + log.debug("Generated URL: " + dataURL); + return dataURL; + } + + public static void regenerateSession(HttpServletRequest request) { request.getSession(false).invalidate(); request.getSession(true); @@ -1393,12 +1399,16 @@ public class PdfAsHelper { public static String generateDataURLSL20(HttpServletRequest request, HttpServletResponse response) { - return generateURL(request, response, PDF_SL20_DATAURL_PAGE); + return generateURL(request, response, PDF_SL20_DATAURL_PAGE, + WebConfiguration.getPublicDataURL() != null + ? WebConfiguration.getPublicDataURL() : WebConfiguration.getPublicURL()); } public static String generateDataURL(HttpServletRequest request, HttpServletResponse response) { - return generateURL(request, response, PDF_DATAURL_PAGE); + return generateURL(request, response, PDF_DATAURL_PAGE, + WebConfiguration.getPublicDataURL() != null + ? WebConfiguration.getPublicDataURL() : WebConfiguration.getPublicURL()); } public static String generateProvideURL(HttpServletRequest request, |