Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Servlet redirect

resp.sendRedirect("/myurl");
req.getSession().setAttribute("foo", "bar");

In this case, do I have access to the foo attribute after the redirect? On generally speaking, a servlet is completely executed before the redirect is made or it stops it's execution after the redirect line?

Thanks

like image 920
TGM Avatar asked Sep 30 '11 15:09

TGM


1 Answers

It continues execution.

It's not a return, it just adds information to the response.

like image 197
Dave Newton Avatar answered Oct 16 '22 14:10

Dave Newton