aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-web')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java49
1 files changed, 21 insertions, 28 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java
index 94c8cd0..03db607 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java
@@ -27,12 +27,14 @@
package at.gv.egiz.pdfas.web.servlets;
import java.io.BufferedInputStream;
+import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
@@ -111,6 +113,7 @@ public class SignServlet extends HttpServlet
public static final String SUBMITFORM_FILE_KEY = "signupload.jsp:fileKey";
public static final String SUBMITFORM_FILENAME_KEY = "signupload.jsp:filenameKey";
public static final String SUBMITFORM_PREVIEW = "signupload.jsp:previewKey";
+
@@ -148,6 +151,7 @@ public class SignServlet extends HttpServlet
ExternAppInformation exappinf = null;
SignaturePositioning sigpos = null;
+
// for performance measurement
long startTime = 0;
if (statLog.isInfoEnabled()) {
@@ -221,7 +225,8 @@ public class SignServlet extends HttpServlet
{
// tzefferer: modified
// UploadedData ud = retrieveUploadedDataFromRequest(request);
- UploadedData ud_form = retrieveUploadedDataFromRequest(request);
+
+ UploadedData ud_form = retrieveUploadedDataFromRequest(request);
ud = ud_form;
// end modify
@@ -230,14 +235,11 @@ public class SignServlet extends HttpServlet
{
log.error(e);
- //Added by rpiazzi to know if error happened when request was within iframe
- //In this case the visualization of the error has to be done differently
+ //Added by rpiazzi to check if this attribute is still null
HttpSession session = request.getSession();
- if (((String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY)).equals(Constants.SIGNATURE_DEVICE_BKU)) {
- request.setAttribute(ERROR_WITHIN_IFRAME, "no");
- }
- else {
- request.setAttribute(ERROR_WITHIN_IFRAME, "yes");
+ String error_within_iframe = (String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY);
+ if (error_within_iframe==null) {
+ session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, "no");
}
//end added
@@ -252,14 +254,11 @@ public class SignServlet extends HttpServlet
catch (FileUploadException e) {
log.error(e);
- //Added by rpiazzi to know if error happened when request was within iframe
- //In this case the visualization of the error has to be done differently
+ //Added by rpiazzi to check if this attribute is still null
HttpSession session = request.getSession();
- if (((String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY)).equals(Constants.SIGNATURE_DEVICE_BKU)) {
- request.setAttribute(ERROR_WITHIN_IFRAME, "no");
- }
- else {
- request.setAttribute(ERROR_WITHIN_IFRAME, "yes");
+ String error_within_iframe = (String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY);
+ if (error_within_iframe==null) {
+ session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, "no");
}
//end added
@@ -271,14 +270,11 @@ public class SignServlet extends HttpServlet
catch (IOException e) {
log.error(e);
- //Added by rpiazzi to know if error happened when request was within iframe
- //In this case the visualization of the error has to be done differently
+ //Added by rpiazzi to check if this attribute is still null
HttpSession session = request.getSession();
- if (((String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY)).equals(Constants.SIGNATURE_DEVICE_BKU)) {
- request.setAttribute(ERROR_WITHIN_IFRAME, "no");
- }
- else {
- request.setAttribute(ERROR_WITHIN_IFRAME, "yes");
+ String error_within_iframe = (String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY);
+ if (error_within_iframe==null) {
+ session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, "no");
}
//end added
@@ -478,9 +474,6 @@ public class SignServlet extends HttpServlet
session.setAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY, "bku");
sig_app = "bku";
- session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, "no");
-
-
mode = (String)session.getAttribute(SUBMITFORM_SIGNATURE_MODE_KEY);
doc_file_name = (String)session.getAttribute(SUBMITFORM_FILENAME_KEY);
pdfDataSource = (DataSource)session.getAttribute(SUBMITFORM_FILE_KEY);
@@ -508,7 +501,7 @@ public class SignServlet extends HttpServlet
log.debug(" filesize = " + item.getSize()); //$NON-NLS-1$
}
}
-
+
if (item.getFieldName().equals(FormFields.FIELD_SIGNATURE_TYPE))
{
sig_type_fi = item;
@@ -742,13 +735,13 @@ public class SignServlet extends HttpServlet
//Added by rpiazzi to know if error happened when request was within iframe
//In this case the visualization of the error has to be done differently
- HttpSession session = request.getSession();
+ /*HttpSession session = request.getSession();
if (((String)session.getAttribute(SUBMITFORM_SIGNATURE_DEVICE_KEY)).equals(Constants.SIGNATURE_DEVICE_BKU)) {
request.setAttribute(ERROR_WITHIN_IFRAME, "no");
}
else {
request.setAttribute(ERROR_WITHIN_IFRAME, "yes");
- }
+ }*/
//end added