1
I am facing the following problem, I am making the following redirection:
response.sendRedirect("../../index.jsp?NA=1");
Where the url goes 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!");
}
}
%>
Could someone please help me? Thanks in advance!
Can post the form code please?
– Cleiton Oliveira
I am not using form, I am creating the variable directly in the url! I’m a beginner in jsp, I did it in PHP without problems, I don’t know if you have any problem in jsp.
– Nayron Morais
Have you tried instead of
Object obj = request.getAttribute("NA");
useObject obj = request.getParameter("NA");
– Laércio Lopes
@Laérciolopes Your suggestion came true, thank you very much!
– Nayron Morais