Error getting GET attribute in jsp!

1

I'm facing the following problem, I'm doing the following redirect:

response.sendRedirect("../../index.jsp?NA=1");

Where the url looks like this:

http://localhost:9095/Controle_de_Materiais/index.jsp?NA=1

But when I try to get the attribute, it only gives null:

 <%

        Object obj = request.getAttribute("NA");

        System.out.println("Atributo == " + obj);

        if( obj != null){

             if(Integer.parseInt(obj.toString()) == 1){

               out.println("<p style='float: right;' class='text-danger'><i class='glyphicon glyphicon-asterisk'></i> Credênciais Inválidas!");

                }

        }
  %>

Output:

Could anyone help me please? Thank you!

    
asked by anonymous 31.12.2016 / 02:12

1 answer

1

You should use:

Object obj = request.getParameter("NA");

Instead of:

Object obj = request.getAttribute("NA");
    
31.12.2016 / 16:20