Pass value of href jquery to Spring MVC

Asked

Viewed 92 times

2

Good afternoon guys, I am having trouble passing an id that is in the jquery href for Spring MVC controller update method. Someone could help me. Thank you.

$.ajax({
        url : "listAllForum",
        dataType : 'json',
        success : function(data) {
            $.each(data, function(index, objeto) {
                $('#post-forum').last().append('<div class="jumbotron"> <strong>Nome do usuário que postou a mensagem!!!</strong> - ' 
                        +' Data: <br>' + objeto.message + '<br> <br>'
                        + '<input type="text" size="90" placeholder="Redigir uma resposta" id="answer" name="answer" />'
                        + ' <br> <br> <a href='**/update/**' + objeto.idForum + '>Responder</a> </div>');
                });
        }
    });

When I click Reply instead of calling the controller method, it calls an update page.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.