Program is behaving differently when Submit and $post of Jquery is used












0















I am going through a confusing situation where when button is clicked a pdf should get downloaded. My design and requirement is something like below:




  1. Click the button

  2. show confirm box with two buttons save and open

  3. If save is selected then pdf should be saved on local computer.


3rd point is where I am facing the problem because when there is no confirm box. Here when form is submitted using submit button (no confirm box) then file is getting downloaded. Below is code:



<button type="submit" id="Export">xxx_tutorial</button>


But when there is just a button with onclick event for confirmation box written in jQuery and I have used $Post to submit the data to servlet where data is passed to servlet but file is not getting downloaded.



Now my question is:




  1. Is passing the data through $post is not equivalent to submit along with passing data to servlet what happens when submit button is clicked.


  2. When the data is passed to servlet why file is not getting downloaded where the same code is working when using submit button without confirmation box.



Below is code:



JSP:



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/redmond/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<!-- User Defined Js file -->
<script type="text/javascript">

$(document).ready(function(){
$('#Export').click(function(event) {
event.preventDefault();
var currentForm = $(this).closest('form');

var dynamicDialog = $('<div id="conformBox">'+
'<span style="float:left; margin:0 7px 20px 0;">'+
'</span>Open or save the document</div>');

dynamicDialog.dialog({
title : "Open/Save Dialog",
closeOnEscape: true,
modal : true,

buttons :
[{
text : "Export",
click : function() {

$(this).dialog("close");
var data = "xxx_tutorial";
$.post('button', {param: data}, function(param){


});
}
},
{
text : "Open",
click : function() {
$(this).dialog("close");
}
}]
});
return false;
});

});
</script>
</head>
<body>
<button type="button" id="Export">xxx_tutorial</button>

</body>
</html>


Servlet:



package com.testcase.testing;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class button
*/
@WebServlet("/button")
public class button extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public button() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(request, response);
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

response.getWriter().append(request.getParameter("param"));
performTask(request,response);
}

private void performTask(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {

String pdfFileName="";

if(request.getParameter("param")==null){

}
else if(request.getParameter("param").matches("sap_webi_tutorial")){
System.out.println("in create pdf file name part");
pdfFileName = "/"+request.getParameter("param")+".pdf";
}
else{

}

String contextPath = getServletContext().getRealPath(File.separator);
File pdfFile = new File(contextPath + "/xxx_tutorial.pdf");
response.setContentType("application/pdf");
response.addHeader("Content-Disposition", "attachment; filename=" + "/xxx_tutorial.pdf");
response.setContentLength((int) pdfFile.length());

FileInputStream fileInputStream = new FileInputStream(pdfFile);
PrintWriter responseOutputStream = response.getWriter();
int bytes;
while ((bytes = fileInputStream.read()) != -1) {
responseOutputStream.write(bytes);
}
fileInputStream.close();
responseOutputStream.flush();
responseOutputStream.close();
}
}









share|improve this question





























    0















    I am going through a confusing situation where when button is clicked a pdf should get downloaded. My design and requirement is something like below:




    1. Click the button

    2. show confirm box with two buttons save and open

    3. If save is selected then pdf should be saved on local computer.


    3rd point is where I am facing the problem because when there is no confirm box. Here when form is submitted using submit button (no confirm box) then file is getting downloaded. Below is code:



    <button type="submit" id="Export">xxx_tutorial</button>


    But when there is just a button with onclick event for confirmation box written in jQuery and I have used $Post to submit the data to servlet where data is passed to servlet but file is not getting downloaded.



    Now my question is:




    1. Is passing the data through $post is not equivalent to submit along with passing data to servlet what happens when submit button is clicked.


    2. When the data is passed to servlet why file is not getting downloaded where the same code is working when using submit button without confirmation box.



    Below is code:



    JSP:



    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/redmond/jquery-ui.css">
    <script src="https://code.jquery.com/jquery-1.11.2.js"></script>
    <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
    <!-- User Defined Js file -->
    <script type="text/javascript">

    $(document).ready(function(){
    $('#Export').click(function(event) {
    event.preventDefault();
    var currentForm = $(this).closest('form');

    var dynamicDialog = $('<div id="conformBox">'+
    '<span style="float:left; margin:0 7px 20px 0;">'+
    '</span>Open or save the document</div>');

    dynamicDialog.dialog({
    title : "Open/Save Dialog",
    closeOnEscape: true,
    modal : true,

    buttons :
    [{
    text : "Export",
    click : function() {

    $(this).dialog("close");
    var data = "xxx_tutorial";
    $.post('button', {param: data}, function(param){


    });
    }
    },
    {
    text : "Open",
    click : function() {
    $(this).dialog("close");
    }
    }]
    });
    return false;
    });

    });
    </script>
    </head>
    <body>
    <button type="button" id="Export">xxx_tutorial</button>

    </body>
    </html>


    Servlet:



    package com.testcase.testing;

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.PrintWriter;

    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    /**
    * Servlet implementation class button
    */
    @WebServlet("/button")
    public class button extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
    * @see HttpServlet#HttpServlet()
    */
    public button() {
    super();
    // TODO Auto-generated constructor stub
    }

    /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    doPost(request, response);
    }

    /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub

    response.getWriter().append(request.getParameter("param"));
    performTask(request,response);
    }

    private void performTask(HttpServletRequest request, HttpServletResponse response) throws ServletException,
    IOException {

    String pdfFileName="";

    if(request.getParameter("param")==null){

    }
    else if(request.getParameter("param").matches("sap_webi_tutorial")){
    System.out.println("in create pdf file name part");
    pdfFileName = "/"+request.getParameter("param")+".pdf";
    }
    else{

    }

    String contextPath = getServletContext().getRealPath(File.separator);
    File pdfFile = new File(contextPath + "/xxx_tutorial.pdf");
    response.setContentType("application/pdf");
    response.addHeader("Content-Disposition", "attachment; filename=" + "/xxx_tutorial.pdf");
    response.setContentLength((int) pdfFile.length());

    FileInputStream fileInputStream = new FileInputStream(pdfFile);
    PrintWriter responseOutputStream = response.getWriter();
    int bytes;
    while ((bytes = fileInputStream.read()) != -1) {
    responseOutputStream.write(bytes);
    }
    fileInputStream.close();
    responseOutputStream.flush();
    responseOutputStream.close();
    }
    }









    share|improve this question



























      0












      0








      0








      I am going through a confusing situation where when button is clicked a pdf should get downloaded. My design and requirement is something like below:




      1. Click the button

      2. show confirm box with two buttons save and open

      3. If save is selected then pdf should be saved on local computer.


      3rd point is where I am facing the problem because when there is no confirm box. Here when form is submitted using submit button (no confirm box) then file is getting downloaded. Below is code:



      <button type="submit" id="Export">xxx_tutorial</button>


      But when there is just a button with onclick event for confirmation box written in jQuery and I have used $Post to submit the data to servlet where data is passed to servlet but file is not getting downloaded.



      Now my question is:




      1. Is passing the data through $post is not equivalent to submit along with passing data to servlet what happens when submit button is clicked.


      2. When the data is passed to servlet why file is not getting downloaded where the same code is working when using submit button without confirmation box.



      Below is code:



      JSP:



      <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%>
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/redmond/jquery-ui.css">
      <script src="https://code.jquery.com/jquery-1.11.2.js"></script>
      <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
      <!-- User Defined Js file -->
      <script type="text/javascript">

      $(document).ready(function(){
      $('#Export').click(function(event) {
      event.preventDefault();
      var currentForm = $(this).closest('form');

      var dynamicDialog = $('<div id="conformBox">'+
      '<span style="float:left; margin:0 7px 20px 0;">'+
      '</span>Open or save the document</div>');

      dynamicDialog.dialog({
      title : "Open/Save Dialog",
      closeOnEscape: true,
      modal : true,

      buttons :
      [{
      text : "Export",
      click : function() {

      $(this).dialog("close");
      var data = "xxx_tutorial";
      $.post('button', {param: data}, function(param){


      });
      }
      },
      {
      text : "Open",
      click : function() {
      $(this).dialog("close");
      }
      }]
      });
      return false;
      });

      });
      </script>
      </head>
      <body>
      <button type="button" id="Export">xxx_tutorial</button>

      </body>
      </html>


      Servlet:



      package com.testcase.testing;

      import java.io.File;
      import java.io.FileInputStream;
      import java.io.IOException;
      import java.io.OutputStream;
      import java.io.PrintWriter;

      import javax.servlet.ServletException;
      import javax.servlet.annotation.WebServlet;
      import javax.servlet.http.HttpServlet;
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;

      /**
      * Servlet implementation class button
      */
      @WebServlet("/button")
      public class button extends HttpServlet {
      private static final long serialVersionUID = 1L;

      /**
      * @see HttpServlet#HttpServlet()
      */
      public button() {
      super();
      // TODO Auto-generated constructor stub
      }

      /**
      * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
      */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      doPost(request, response);
      }

      /**
      * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
      */
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub

      response.getWriter().append(request.getParameter("param"));
      performTask(request,response);
      }

      private void performTask(HttpServletRequest request, HttpServletResponse response) throws ServletException,
      IOException {

      String pdfFileName="";

      if(request.getParameter("param")==null){

      }
      else if(request.getParameter("param").matches("sap_webi_tutorial")){
      System.out.println("in create pdf file name part");
      pdfFileName = "/"+request.getParameter("param")+".pdf";
      }
      else{

      }

      String contextPath = getServletContext().getRealPath(File.separator);
      File pdfFile = new File(contextPath + "/xxx_tutorial.pdf");
      response.setContentType("application/pdf");
      response.addHeader("Content-Disposition", "attachment; filename=" + "/xxx_tutorial.pdf");
      response.setContentLength((int) pdfFile.length());

      FileInputStream fileInputStream = new FileInputStream(pdfFile);
      PrintWriter responseOutputStream = response.getWriter();
      int bytes;
      while ((bytes = fileInputStream.read()) != -1) {
      responseOutputStream.write(bytes);
      }
      fileInputStream.close();
      responseOutputStream.flush();
      responseOutputStream.close();
      }
      }









      share|improve this question
















      I am going through a confusing situation where when button is clicked a pdf should get downloaded. My design and requirement is something like below:




      1. Click the button

      2. show confirm box with two buttons save and open

      3. If save is selected then pdf should be saved on local computer.


      3rd point is where I am facing the problem because when there is no confirm box. Here when form is submitted using submit button (no confirm box) then file is getting downloaded. Below is code:



      <button type="submit" id="Export">xxx_tutorial</button>


      But when there is just a button with onclick event for confirmation box written in jQuery and I have used $Post to submit the data to servlet where data is passed to servlet but file is not getting downloaded.



      Now my question is:




      1. Is passing the data through $post is not equivalent to submit along with passing data to servlet what happens when submit button is clicked.


      2. When the data is passed to servlet why file is not getting downloaded where the same code is working when using submit button without confirmation box.



      Below is code:



      JSP:



      <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%>
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/redmond/jquery-ui.css">
      <script src="https://code.jquery.com/jquery-1.11.2.js"></script>
      <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
      <!-- User Defined Js file -->
      <script type="text/javascript">

      $(document).ready(function(){
      $('#Export').click(function(event) {
      event.preventDefault();
      var currentForm = $(this).closest('form');

      var dynamicDialog = $('<div id="conformBox">'+
      '<span style="float:left; margin:0 7px 20px 0;">'+
      '</span>Open or save the document</div>');

      dynamicDialog.dialog({
      title : "Open/Save Dialog",
      closeOnEscape: true,
      modal : true,

      buttons :
      [{
      text : "Export",
      click : function() {

      $(this).dialog("close");
      var data = "xxx_tutorial";
      $.post('button', {param: data}, function(param){


      });
      }
      },
      {
      text : "Open",
      click : function() {
      $(this).dialog("close");
      }
      }]
      });
      return false;
      });

      });
      </script>
      </head>
      <body>
      <button type="button" id="Export">xxx_tutorial</button>

      </body>
      </html>


      Servlet:



      package com.testcase.testing;

      import java.io.File;
      import java.io.FileInputStream;
      import java.io.IOException;
      import java.io.OutputStream;
      import java.io.PrintWriter;

      import javax.servlet.ServletException;
      import javax.servlet.annotation.WebServlet;
      import javax.servlet.http.HttpServlet;
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;

      /**
      * Servlet implementation class button
      */
      @WebServlet("/button")
      public class button extends HttpServlet {
      private static final long serialVersionUID = 1L;

      /**
      * @see HttpServlet#HttpServlet()
      */
      public button() {
      super();
      // TODO Auto-generated constructor stub
      }

      /**
      * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
      */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      doPost(request, response);
      }

      /**
      * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
      */
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub

      response.getWriter().append(request.getParameter("param"));
      performTask(request,response);
      }

      private void performTask(HttpServletRequest request, HttpServletResponse response) throws ServletException,
      IOException {

      String pdfFileName="";

      if(request.getParameter("param")==null){

      }
      else if(request.getParameter("param").matches("sap_webi_tutorial")){
      System.out.println("in create pdf file name part");
      pdfFileName = "/"+request.getParameter("param")+".pdf";
      }
      else{

      }

      String contextPath = getServletContext().getRealPath(File.separator);
      File pdfFile = new File(contextPath + "/xxx_tutorial.pdf");
      response.setContentType("application/pdf");
      response.addHeader("Content-Disposition", "attachment; filename=" + "/xxx_tutorial.pdf");
      response.setContentLength((int) pdfFile.length());

      FileInputStream fileInputStream = new FileInputStream(pdfFile);
      PrintWriter responseOutputStream = response.getWriter();
      int bytes;
      while ((bytes = fileInputStream.read()) != -1) {
      responseOutputStream.write(bytes);
      }
      fileInputStream.close();
      responseOutputStream.flush();
      responseOutputStream.close();
      }
      }






      javascript java jquery jsp servlets






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 22:32









      halfer

      14.7k759116




      14.7k759116










      asked May 27 '17 at 9:10









      SivaSiva

      7,77482847




      7,77482847
























          1 Answer
          1






          active

          oldest

          votes


















          0














          If you submit the form, the page displayed in the browser will receive the reults of that operation - it's like clicking a link so to say.



          Calling $.post() would instead send data in the background and return the result-data into your callback-function (which is empty in the code you posted). So you'd have to deal with the result in that function.



          See post documentation for background



          Maybe you could do your logic and then instead of calling $.post() you simply ubmit the form from within JavaScript code?



          Check this for submitting your form directly:



          JavaScript post request like a form submit






          share|improve this answer
























          • Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

            – Siva
            May 27 '17 at 9:32












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44215033%2fprogram-is-behaving-differently-when-submit-and-post-of-jquery-is-used%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you submit the form, the page displayed in the browser will receive the reults of that operation - it's like clicking a link so to say.



          Calling $.post() would instead send data in the background and return the result-data into your callback-function (which is empty in the code you posted). So you'd have to deal with the result in that function.



          See post documentation for background



          Maybe you could do your logic and then instead of calling $.post() you simply ubmit the form from within JavaScript code?



          Check this for submitting your form directly:



          JavaScript post request like a form submit






          share|improve this answer
























          • Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

            – Siva
            May 27 '17 at 9:32
















          0














          If you submit the form, the page displayed in the browser will receive the reults of that operation - it's like clicking a link so to say.



          Calling $.post() would instead send data in the background and return the result-data into your callback-function (which is empty in the code you posted). So you'd have to deal with the result in that function.



          See post documentation for background



          Maybe you could do your logic and then instead of calling $.post() you simply ubmit the form from within JavaScript code?



          Check this for submitting your form directly:



          JavaScript post request like a form submit






          share|improve this answer
























          • Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

            – Siva
            May 27 '17 at 9:32














          0












          0








          0







          If you submit the form, the page displayed in the browser will receive the reults of that operation - it's like clicking a link so to say.



          Calling $.post() would instead send data in the background and return the result-data into your callback-function (which is empty in the code you posted). So you'd have to deal with the result in that function.



          See post documentation for background



          Maybe you could do your logic and then instead of calling $.post() you simply ubmit the form from within JavaScript code?



          Check this for submitting your form directly:



          JavaScript post request like a form submit






          share|improve this answer













          If you submit the form, the page displayed in the browser will receive the reults of that operation - it's like clicking a link so to say.



          Calling $.post() would instead send data in the background and return the result-data into your callback-function (which is empty in the code you posted). So you'd have to deal with the result in that function.



          See post documentation for background



          Maybe you could do your logic and then instead of calling $.post() you simply ubmit the form from within JavaScript code?



          Check this for submitting your form directly:



          JavaScript post request like a form submit







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 27 '17 at 9:20









          JanJan

          12.4k32144




          12.4k32144













          • Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

            – Siva
            May 27 '17 at 9:32



















          • Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

            – Siva
            May 27 '17 at 9:32

















          Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

          – Siva
          May 27 '17 at 9:32





          Sir thanks for the answer... actually my code for download is in servlet so I have just passed the data to servlet but how do I catch the download file back in jsp is there any way for this, because I tried with javascript but my requirement is I need to have a custom confirmation box which is possible only through Jquery

          – Siva
          May 27 '17 at 9:32




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44215033%2fprogram-is-behaving-differently-when-submit-and-post-of-jquery-is-used%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

          ComboBox Display Member on multiple fields

          Is it possible to collect Nectar points via Trainline?