java - my response.sendRedirect(); is not working -
i'm trying redirect new page syntax
try { usuarios usu = new usuarios(); usu.setnombreusuario(request.getparameter("parcodigo")); system.out.println(usu.getusuario()); usu.setcontrasena(request.getparameter("parcontrasenha")); system.out.println(usu.getcontrasena()); usu = usuariosdao.login(usu); system.out.println("es valido? " + usu.isvalid()); if (usu.isvalid()) { httpsession session = request.getsession(true); session.setattribute("usuario", usu.getusuario()); response.sendredirect("/kolaescocesacrm/menumobile.jsp"); return; } else { response.sendredirect("/kolaescocesacrm/loginmobile.jsp"); } } catch (exception ex) { ex.printstacktrace(); }
my problem when submit this:
http://localhost:8084/kolaescocesacrm/srvmenu2?parcodigo=admin&parcontrasenha=kola
i don't know please fine
if dear 404
most of time, because entry application mapped /myapp
instead of /
(root)
the server says browser go /kolaescocesacrm/loginmobile.jsp
should /.myapp/kolaescocesacrm/loginmobile.jsp
the simplest way changing context-path root (/
or empty string)
Comments
Post a Comment