Session Data Sharing using response.sendRedirect, RequestDispatcher.forward
prefer response.sendRedirect instead of RequestDispatcher.forward
User sees JSP URL (user only able to see servlet URL in case RequestDispatcher.forward)
There is need of Two round trips to client (whereas only one with forward)
I wonder why two round trips in case of response.sendRedirect???? whereas only one for RequestDispatcher.forward
sendRedirect has advantaes of User can separately visit JSP page, bookmark JSP page
sendRedirect has Disadvantage user can visit directly JSP page without going through servlet first so JSP data may not be there, so need to code JSP page to detect this situation
How to code JSP page to detect this situation???
I wonder what these advantages, disadvantages means in detail, practically???
response.sendRedirect, RequestDispatcher.forward concept is there in servlets as well apart from JSP.
I remember reading only RequestDispatcher.forward in servlets not response.sendRedirect
Any links resources ideas highly appreciated. Thanks in advance