Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
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?

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda