From dd8bbd11e5c2642737ea3443b8e6f78d06326047 Mon Sep 17 00:00:00 2001 From: rpiazzi Date: Wed, 8 Feb 2012 16:14:05 +0000 Subject: Removed setting null of the session attributes git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@915 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- pdf-as-web/src/main/webapp/jsp/signupload.jsp | 51 +++++++++++++-------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'pdf-as-web/src/main') diff --git a/pdf-as-web/src/main/webapp/jsp/signupload.jsp b/pdf-as-web/src/main/webapp/jsp/signupload.jsp index ba7651b..89a9360 100644 --- a/pdf-as-web/src/main/webapp/jsp/signupload.jsp +++ b/pdf-as-web/src/main/webapp/jsp/signupload.jsp @@ -19,9 +19,25 @@ <% - session = request.getSession(); - - session.removeAttribute(SessionAttributes.DOWNLOAD_URL_FOR_SIGNED_PDF_DOCUMENT); + //Get the previous settings if user hitted back or back link + //Many of this settings do not apply anymore + String sign_mode=null; + String source_mode=null; + String sign_type=null; + String sign_pdfa=null; + String sign_note=null; + String sign_freetext=null; + String sessionLang = null; + + sessionLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); + sign_mode = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_MODE_KEY); + source_mode = (String)session.getAttribute(SignServlet.SUBMITFORM_SOURCE_KEY); + sign_type = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_TYPE_KEY); + sign_pdfa = (String)session.getAttribute(SignServlet.SUBMITFORM_PDFA_KEY); + sign_note = (String)session.getAttribute(SignServlet.SUBMITFORM_NOTE_KEY); + sign_freetext = (String)session.getAttribute(SignServlet.SUBMITFORM_FREETEXT_KEY); + + session.removeAttribute(SessionAttributes.DOWNLOAD_URL_FOR_SIGNED_PDF_DOCUMENT); session.removeAttribute(SessionAttributes.SIGNED_PDF_DOCUMENT); String serverUrl=LocalRequestHelper.getLocalServerAddress(request,response); @@ -64,7 +80,7 @@ //boolean forceTextualForMocca = false; String requestLang = (String)request.getParameter("locale"); - String sessionLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); + sessionLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); String language = ""; //If language within session... @@ -109,16 +125,11 @@ } } - String sign_freetext = ""; + if (sign_freetext==null) { + sign_freetext = ""; + } + - //Get the previous settings if user hitted back or back link - //Many of this settings do not apply anymore - String sign_mode = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_MODE_KEY); - String source_mode = (String)session.getAttribute(SignServlet.SUBMITFORM_SOURCE_KEY); - String sign_type = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_TYPE_KEY); - String sign_pdfa = (String)session.getAttribute(SignServlet.SUBMITFORM_PDFA_KEY); - String sign_note = (String)session.getAttribute(SignServlet.SUBMITFORM_NOTE_KEY); - sign_freetext = (String)session.getAttribute(SignServlet.SUBMITFORM_FREETEXT_KEY); if (german) { %> @@ -883,20 +894,6 @@ detectBrowser(); - <% - //After loading the page set all attributes to null - session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_MODE_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_SOURCE_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_TYPE_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_PDFA_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_NOTE_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_FREETEXT_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_DEVICE_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_FILE_KEY, null); - session.setAttribute(SignServlet.SUBMITFORM_FILENAME_KEY, null); - session.setAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION, null); - session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, null); - %> -- cgit v1.2.3