Problems with Web Applications

0

There was a problem when trying out an application, and it is that when making a query it does not perform it and the worst thing that with other web apps nothing of this happens only with the mozilla. This is the function that invokes the controller:

$("#alumnosFrm").submit(function() {
    event.preventDefault();
    realizaPost('./buscaAlumnos.do', '#alumnosFrm', '#divResultadoAlumnos', 'divResultadoAlumnos');
});

And this is the controller code:

@RequestMapping({"/buscaAlumnos.do"})
    public String buscaAlumnos(HttpServletRequest request, 
            @ModelAttribute AlumnoTO alumnoIN,
            ModelMap modelMap){
        HttpSession session = request.getSession(false);
        if(session == null || session.getAttribute("usuarioTO") == null){       
            ExceptionTO mensajeErrorTO = new ExceptionTO();
            mensajeErrorTO.setMensaje("La sesión ha terminado. Vuelva ingresar al sistema por favor");
                modelMap.addAttribute("mensajeErrorTO", mensajeErrorTO);
            return "comunes/error";             
        }
        log.debug(">>> INICIO: AlumnosController.buscaAlumnos");

        List<AlumnoTO> alumnos = null;
        AlumnoFacade alumnoFacade = AlumnoFacade.getInstance();

        try {
            alumnos = alumnoFacade.buscaAlumnos(alumnoIN);
            modelMap.addAttribute("alumnos", alumnos);

        } catch (MakeitException e) {
            log.debug(">>> ERROR: AlumnosController.buscaAlumnos");

            MensajeTO mensajeTO = new MensajeTO();
            mensajeTO.setIdMensaje(e.getId());
            mensajeTO.setMensaje(e.getMessage());
            modelMap.addAttribute("mensajeErrorTO", mensajeTO);
            return "comunes/error";
        }       
        return "alumnos/resultAlumnos";     
    }

And in this picture is the screen where the problem occurs from the search button:

Here I provide the code where the function of performingPost is invoked:

function realizaPost(url, idForm, divResult, idLoadingTarget) {

var spinner = loading (idLoadingTarget);     if (idForm! = null) {

    $.post(url, $(idForm).serialize(), function(data){

        //Esta validacion sirve para que el resultado no se pinte en donde se muestra el Spinner 
        //y pinte el resultado en el divPrincipal
        if(data.indexOf("n ha terminado") != -1) {
            $("#divPrincipal").empty().append(data);
            stopLoading(spinner);

        } else {

            //SUCCESS
             $(divResult).empty().append(data);
             stopLoading(spinner);

        }

    }).fail(function() {
        //FAIL

    });


} else {
    $.post(url, function(data){         
        $(divResult).empty().append(data);
        stopLoading(spinner);
    });
}

}

    
asked by cratus666jose 20.12.2016 в 00:47
source

0 answers