Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
How can i pass input data from JSP to jQuery data table and receive on Controller?

i am letting user enter some data in text field, and on button press,i am calling below JQuery function and making Ajax call inside.

Below is my JQuery Function and Input field details.

$("#SearchByVIN").click(function() {
        $("#error").hide();
                var formData = $('#vinSerach').serialize();
                $.ajax({  
                    type: "POST",  
                    url: "ErrorVin",
                    data: formData,
                    crossDomain: false,
                    async : true,
                    success: function(response) {
                        if(response){ 
                            $("#error").show();
                            $("#error").html(response);
                            $(window).scrollTop($('#error').offset().top);
                        }else{

                            $("#searchResult").show();
                            $("#searchResult_info").show();
                            $("#searchResult_paginate").show();
                             var oTable = $('#searchResult').dataTable( {
                                    "bDestroy": true,
                                    "iDisplayLength": 2,
                                    "bFilter": false,
                                    "bFilter": false,
                                    "bLengthChange": false,
                                    "sAjaxSource": "SearchByVIN",
                                    "aoColumns": [
                                           { "mData": "gdId" },
                                        { "mData": "agency" },
                                        { "mData": "documentType" },
                                        { "mData": "countyName" },
                                        { "mData": "organizationName" }
                                    ]
                             } );
                        }
                    }, 
                    error: function(result){
                        alert(result);
                    }
                });
    });

Note that, first i am calling url: "ErrorVin", method in controller. In which, i am properly recieving data in controller using Form Bean. But when it comes in else, i am using "sAjaxSource": "SearchByVIN", but in this case, i am not revieving any jsp input values in controller method mapped with this url. So, if i want to pass input values from my input parameter in this second call, how can i achieve that?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!