Parameter passing via AJAX

0

I am developing the customer registration part of my application and are registering in the database normally, but I would like that when I register and be redirected to page ConfirmacaoCadastro.jsp it would take the email that I passed by parameter and put on the page more this is not happening.

AJAX

 function cadastrar(){


           $.ajax({  
type: "POST",  
url: "CadastroCliente",  
data: {
    nome: $("input[id=nome]").val(),
    cep: $("input[id=cep]").val(),
    celular: $("input[id=nr_celular]").val(),

    cpf: $("input[id=cpf]").val(),
    uf: $("input[id=uf]").val(),

    cidade: $("input[id=cidade]").val(),
    rua: $("input[id=rua]").val(),
    rg: $("input[id=rg]").val(),

    bairro: $("input[id=bairro]").val(),
    telefone: $("input[id=telefone]").val(),
    login: $("input[id=login]").val(),
   senha: $("input[id=senha]").val(),
    confirmar_senha: $("input[id=confirma_senha]").val(),
    data_nascimento: $("input[id=nascimento_dt]").val(),
     estado_civil: $("input[name='status']:checked").val(),
     sexo: $("input[name='sexo']:checked").val(),
     email: $("input[id=email]").val(),

},


success: function(result){   
 window.location.href = "ConfirmacaoCadastro.jsp?email="+email;

},
 error:function(){
     alert("erro");
        },
});

       } 

ConfirmationCadastro.jsp

           <div class="row">

           <div class="col-sm-4">

                       <h3> Confirmação de Cadastro </h3>

                        </div>


                                </div>

                                <div class="row">


                                    <div class="col-sm-4">

                                        <h4> Seus dados foram enviados para o email <p>${param.email}</p> </h4>

                                    </div>
                                </div>


                                         <div class="row">


                                    <div class="col-sm-4">

                                        <img src="imagens/voltaPagina.JPG" alt="voltarPaginaPrincipal" class="volta">

                                        <a href="index.jsp"> Voltar Pagina Principal</a>

                                    </div>
                                </div>

Page without the email passed through the parameter.

    
asked by anonymous 25.10.2017 / 00:42

1 answer

1

You are concatenating a variable that does not exist (email):

window.location.href = "ConfirmacaoCadastro.jsp?email="+email;     

25.10.2017 / 00:50