hi all I have a saved some value in session like connection object at the time of login.. but after visiting some time I logout and now my session has been invalidate then the resquset should be forwarded to the relogin page... if check it in the following manner.. if(session.getValue("ISEXPIRED")==null){ System.out.println("Forwarding request...."); res.sendRedirect("relogin.jsp?param=close"); System.out.println("It should not be printed..."); } but instead of forwarding request requset the message "It should not be printed..." is get printed.. plz sugeste me ...
thankx
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
posted
0
do a requestDispatcher.sendForward() instead. sendRedirect does not take immediate effect. It will tell the browser to submit a new request for the redirection resource AFTER the service method of the servlet returns. In other words, you need to place a return statement after a redirection to force the servlet to complete the response.
42
Narendra Dhande
Ranch Hand
Joined: Dec 04, 2004
Posts: 950
posted
0
Hello,
Is there any sendForward() method is RequestDispatcher Interface. I think it should be forward(..).