From df3f120f1864c23fb4d53622b6667f31cacf8ecc Mon Sep 17 00:00:00 2001 From: wbauer Date: Wed, 15 Oct 2008 13:15:45 +0000 Subject: added a new viewer page for MSIE and XHTML git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@118 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/webapp/HashDataInputServlet.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'BKUOnline/src/main/java/at/gv/egiz') diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java index 210dce5a..b2d6c21f 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java @@ -74,6 +74,7 @@ public class HashDataInputServlet extends SpringBKUServlet { resp.sendRedirect("multiHashDataInput.html"); return; } + if ((param == null) && (hdi.size() == 1)) { param = hdi.get(0).getReferenceId(); log.debug("Request parameter not set, setting to: " + param); @@ -82,6 +83,7 @@ public class HashDataInputServlet extends SpringBKUServlet { if (hd.getReferenceId().equals(param)) { log.debug("Found hashdatainput for refId:" + param); resp.setContentType(hd.getMimeType()); + String charSet = hd.getEncoding(); if (charSet == null) { charSet = "UTF-8"; @@ -91,8 +93,16 @@ public class HashDataInputServlet extends SpringBKUServlet { String fileExt = hd.getMimeType().equalsIgnoreCase("text/plain") ? ".txt" : ".xhtml"; if (fileExt.equals(".xhtml")) { - resp.addHeader("content-disposition", "attachment; filename=" - + param + fileExt); + if (req.getParameter("ieCType") == null) { + resp.sendRedirect("ieView.html"); + return; + } else { + resp.setContentType(req.getParameter("ieCType")); + if (req.getParameter("ieCType").equals("application/xhtml+xml")) { + resp.addHeader("content-disposition", "attachment; filename=" + + param + ".xhtml"); + } + } } } Reader r = new InputStreamReader(hd.getHashDataInput(), charSet); -- cgit v1.2.3