This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I've a file1.jsp which is as follows : <html> <head> </head> <body> <%= "In FILE1.jsp " %> <jsp:forward page="file2.jsp" /> </body> </html> file2.jsp ---------- <html> <head> </head> <body> <%= "In FILE2.jsp " %> </body> </html> When accessing file1.jsp in Tomcat as http://localhost:8080/file1.jsp I get the o/p as "In FILE2.jsp". The location bar in the browser is the same. i.e http://localhost:8080/file1.jsp When I replace the <jsp:forward> with <jsp:include page="file2.jsp" flush="true"/> still I get the same result and the location bar also reads file1.jsp. Same is the case with "response.sendRedirect("file2.jsp"); But when I was taking some mock up test,it gave explanation as when response.sendRedirect is used, location bar of the browser would display file2.jsp. Pls clarify on whne the address bar will display file2.jsp. Thanks.
Right - when you sendRedirect it updates the Address line in the browser. This is the way your example works for me.... Make sure in your test that you are not seeing a browser cached version of the page.