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 | 26 |
1 files changed, 21 insertions, 5 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 a051396..1c594dd 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 @@ -338,13 +338,13 @@ public class SignServlet extends HttpServlet try
{
HttpSession session = request.getSession(true);
-// not needed, that is done in sign()
-// ud.pdfDataSource = PdfAS.applyStrictMode(ud.pdfDataSource);
+ // not needed, that is done in sign()
+ // ud.pdfDataSource = PdfAS.applyStrictMode(ud.pdfDataSource);
SignSessionInformation si = new SignSessionInformation(); // SessionTable.generateSessionInformationObject();
si.connector = ud.sig_app;
- if ((request.getContextPath().startsWith("/test-")) && (si.connector.equals("mobile"))) {
+ if ((ud.mobileTestEnabled) && (si.connector.equals("mobile"))) {
si.connector = Constants.SIGNATURE_DEVICE_MOBILETEST;
session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_DEVICE_KEY, si.connector);
}
@@ -451,7 +451,7 @@ public class SignServlet extends HttpServlet String mode="";
String doc_file_name;
DataSource pdfDataSource;
-
+ boolean mobileTestEnabled=false;
Iterator it = items.iterator();
session = request.getSession(true);
@@ -531,7 +531,7 @@ public class SignServlet extends HttpServlet if (item.isFormField())
{
String item_string = item.getString("UTF-8"); //$NON-NLS-1$
- log.debug(" form field string = " + item_string); //$NON-NLS-1$
+ log.debug(" form field string = " + item_string); //$NON-NLS-1$
}
else
{
@@ -645,6 +645,15 @@ public class SignServlet extends HttpServlet }
//end added
+ if (FormFields.FIELD_MOBILETEST_ENABLED.equals(item.getFieldName())) {
+ if (item.getString("UTF-8")!=null) {
+ if (item.getString("UTF-8").equals("on")) {
+ mobileTestEnabled=true;
+ }
+ }
+ continue;
+ }
+
throw new ServletException("Unrecognized POST data."); //$NON-NLS-1$
}
@@ -738,6 +747,11 @@ public class SignServlet extends HttpServlet ud.sig_type += "_NOTE";
session.setAttribute(SUBMITFORM_SIGNATURE_TYPE_KEY, ud.sig_type);
}
+
+ if (mobileTestEnabled) {
+ ud.mobileTestEnabled=true;
+ }
+
//end added
return ud;
@@ -868,6 +882,8 @@ public class SignServlet extends HttpServlet protected DataSource pdfDataSource = null;
+ protected boolean mobileTestEnabled = false;
+
//added by rpiazzi
protected boolean note = false;
// protected byte[] pdf = null;
|