diff options
Diffstat (limited to 'pdf-as-web/src/main')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java | 19 |
1 files changed, 15 insertions, 4 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 dcc0bb2..94c8cd0 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 @@ -49,8 +49,8 @@ import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
import at.gv.egiz.pdfas.api.commons.Constants;
import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
@@ -63,6 +63,7 @@ import at.gv.egiz.pdfas.exceptions.external.ExternalErrorException; import at.gv.egiz.pdfas.web.ExternAppInformation;
import at.gv.egiz.pdfas.web.FormFields;
import at.gv.egiz.pdfas.web.helper.ApiHelper;
+import at.gv.egiz.pdfas.web.helper.SessionHelper;
import at.gv.egiz.pdfas.web.helper.SignServletHelper;
import at.gv.egiz.pdfas.web.helper.WebSettingsReader;
import at.gv.egiz.pdfas.web.helper.WebUtils;
@@ -98,6 +99,8 @@ public class SignServlet extends HttpServlet private static Log log = LogFactory.getLog(SignServlet.class);
private static Log statLog = LogFactory.getLog("statistic");
+
+
public static final String SUBMITFORM_SIGNATURE_TYPE_KEY = "signupload.jsp:signatureType";
public static final String SUBMITFORM_SIGNATURE_MODE_KEY = "signupload.jsp:signatureMode";
public static final String SUBMITFORM_SIGNATURE_DEVICE_KEY = "signupload.jsp:signatureKey";
@@ -109,11 +112,15 @@ public class SignServlet extends HttpServlet public static final String SUBMITFORM_FILENAME_KEY = "signupload.jsp:filenameKey";
public static final String SUBMITFORM_PREVIEW = "signupload.jsp:previewKey";
+
+
//Added by rpiazzi to know if an error occured within IFrame because this calls for
//a different display of the error
public static final String ERROR_WITHIN_IFRAME = "error_within_iframe";
//Added by rpiazzi to know the height of the div's in further jsp's
public static final String HEIGHT_SIGN_DIV = "height_sign_div";
+ //Added by rpiazzi
+ public static HttpSession session = null;
protected void dispatch(HttpServletRequest request, HttpServletResponse response, String resource) throws ServletException, IOException
{
@@ -289,6 +296,12 @@ public class SignServlet extends HttpServlet SignSessionInformation si = new SignSessionInformation(); // SessionTable.generateSessionInformationObject();
si.connector = ud.sig_app;
+
+ if ((request.getContextPath().startsWith("/test-")) && (si.connector.equals("mobile"))) {
+ si.connector = Constants.SIGNATURE_DEVICE_MOBILETEST;
+ session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_DEVICE_KEY, si.connector);
+ }
+
si.application = "sign";
si.mode = ud.sig_mode;
si.pdfDataSource = ud.pdfDataSource;
@@ -305,8 +318,6 @@ public class SignServlet extends HttpServlet si.pos = sigpos;
// end add
- HttpSession session = request.getSession();
-
//added by rpiazzi to change signature block with/without note
if (si.note) {
if (si.type.equals(FormFields.VALUE_SIGNATURE_TYPE_DE)) {
@@ -409,7 +420,7 @@ public class SignServlet extends HttpServlet Iterator it = items.iterator();
- HttpSession session = request.getSession();
+ session = request.getSession(true);
|