suprapto45
asked on
Servlet Redirect Question
Hi,
Will the "request" be included?
1st scenario
request.setAttribute("time _arrive_dy namic", dynamic_time_arrive);
request.getRequestDispatch er("/jsp/p lanning/fl ightsearch only.jsp") .forward(r equest, response);
2nd scenario
request.setAttribute("time _arrive_dy namic", dynamic_time_arrive);
response.sendRedirect("https://" + request.getServerName() + "/flightsearch.jsp");
regards
Dave
Will the "request" be included?
1st scenario
request.setAttribute("time
request.getRequestDispatch
2nd scenario
request.setAttribute("time
response.sendRedirect("https://" + request.getServerName() + "/flightsearch.jsp");
regards
Dave
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thats right, a redirect causes the browser to make a new request, whereas a forward is handled internally.
ASKER
Hi,
Thanks. Sorry objects but I will accept cincin77 answer since he is the first to answer. I am sorry. Thanks cincin77 :)
Thus, what is the use of redirect? it seems useless, right?
Thanks. Sorry objects but I will accept cincin77 answer since he is the first to answer. I am sorry. Thanks cincin77 :)
Thus, what is the use of redirect? it seems useless, right?
Thats fine :)
You can only forward relative to the webapp making the call, otherwise you need to redirect.
redirects will also update the address in the browser (as the browser makes the request to the new url)
You can only forward relative to the webapp making the call, otherwise you need to redirect.
redirects will also update the address in the browser (as the browser makes the request to the new url)
So redirect is not useless.:)
thanks for the points.
thanks for the points.
ASKER
I mean can we access the request.getAttribute("time
Regards
Dave