I have a problem that is very similar to this one: How to navigate in JSF? How to make URL reflect current page (and not previous one)
It is actually the same very problem but happens in different situations, and it is when I use a <jsp:forward>
tag
To put you in situation, I have a form that asks for an user and pass to perform login. This redirects to a new page (checklogin.jsp) that performs the checking, updates the session and if everything is ok then it goes like this:
if (con.comprobarUserPass(passmd5)) { // We check everything is OK
sesion.setAttribute("conexion", con);
sesion.setAttribute("pass", passmd5);
%>
<jsp:forward page="index.jsp"/> //forwards to the index
<%
} else {
%>
<jsp:forward page="login.jsp"> // user/pass error, goes back to the login.jsp page
<jsp:param name="error" value="<strong><span style=\"color:red;\">Usuario y/o clave incorrectos. <br>Vuelve a intentarlo.</span></strong>"/>
</jsp:forward>
<% }
} catch (userPassIncorrectoException e) {
%>
<jsp:forward page="login.jsp">
<jsp:param name="error" value="<strong><span style=\"color:red;\">Usuario y/o clave incorrectos. <br>Vuelve a intentarlo.</span></strong>"/>
</jsp:forward>
<% }
%>
Well, the problem appears here, even if I'm redirected to the index.jsp page or to the login.jsp page my url is:
http://localhost:8084/myContext/checklogin.jsp
Any ideas why this is happening? It's making the debug process realy harder than it should be.
checklogin.jsp
? Using javascript ? – Largess<form id="form1" name="form1" method="get" action="checklogin.jsp">
– Mytilene