Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda