aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web
diff options
context:
space:
mode:
authorrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-10-24 17:07:46 +0000
committerrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-10-24 17:07:46 +0000
commit7d9e6231105818b86bf475d3d04db59ae3937b11 (patch)
tree8146089076cb842b16e4d0b63753e9a02191ec98 /pdf-as-web
parentb13b00f05bace428952f0957075bf032ab4cd778 (diff)
downloadpdf-as-3-7d9e6231105818b86bf475d3d04db59ae3937b11.tar.gz
pdf-as-3-7d9e6231105818b86bf475d3d04db59ae3937b11.tar.bz2
pdf-as-3-7d9e6231105818b86bf475d3d04db59ae3937b11.zip
Set request.getSession(true), so that if there is still an old session, but a new one is required
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@876 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'pdf-as-web')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java41
1 files changed, 20 insertions, 21 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 2856a7d..a051396 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
@@ -222,9 +222,6 @@ public class SignServlet extends HttpServlet
log.debug("No signature position provided.");
}
- if (note.equals("true")) {
- sig_type = sig_type + "_NOTE";
- }
// fixed by tknall: if we already have parameters "&" must be used instead of "?"
String paramSeparator = (pdf_url.indexOf("?") != -1) ? "&" : "?";
@@ -251,13 +248,21 @@ public class SignServlet extends HttpServlet
ud_extern.sig_mode = sig_mode;
ud_extern.sig_type = sig_type;
- if (note.equals("true")) {
- ud_extern.note=true;
+ if (note!=null) {
+ if (note.equals("true")) {
+ ud_extern.note=true;
+ ud_extern.sig_type = ud_extern.sig_type + "_NOTE";
+ }
+ else {
+ ud_extern.note=false;
+ }
}
else {
- ud_extern.note=false;
+ ud_extern.note=true;
+ ud_extern.sig_type = ud_extern.sig_type + "_NOTE";
}
- ud_extern.note = true;
+
+
ud_extern.pdfa = false;
ud = ud_extern;
@@ -332,7 +337,7 @@ public class SignServlet extends HttpServlet
}
try
{
- HttpSession session = request.getSession();
+ HttpSession session = request.getSession(true);
// not needed, that is done in sign()
// ud.pdfDataSource = PdfAS.applyStrictMode(ud.pdfDataSource);
@@ -360,19 +365,6 @@ public class SignServlet extends HttpServlet
si.pos = sigpos;
// end add
- //added by rpiazzi to change signature block with/without note
- if ((si.note) && (!si.type.contains("NOTE"))) {
- if (si.type.equals(FormFields.VALUE_SIGNATURE_TYPE_DE)) {
- si.type = "SIGNATURBLOCK_DE_NOTE";
- session.setAttribute(SUBMITFORM_SIGNATURE_TYPE_KEY, si.type);
- }
- else {
- si.type = "SIGNATURBLOCK_EN_NOTE";
- session.setAttribute(SUBMITFORM_SIGNATURE_TYPE_KEY, si.type);
- }
- }
- //End added
-
log.info("Putting signature data into session " + session.getId());
session.setAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION, si);
@@ -741,6 +733,13 @@ public class SignServlet extends HttpServlet
ud.pdfDataSource = pdfDataSource;
ud.note = noteEnabled;
+ //Added by rpiazzi
+ if (ud.note && !ud.sig_type.contains("NOTE")) {
+ ud.sig_type += "_NOTE";
+ session.setAttribute(SUBMITFORM_SIGNATURE_TYPE_KEY, ud.sig_type);
+ }
+ //end added
+
return ud;
}