java - After redirect code still executing from previos page -


how system.out.println("") executed after response has been redirected other resource.

in code:

res.sendredirect("/more_value_in_param/display.jsp"); system.out.println("to avoid penalty , disconnection"); 

why in console to avoid penalty , disconnection being displayed since response has been redirected display.jsp?

the sendredirect() method not halt execution of method.
should either branch code in such way call sendredirect() last statement in method or explicitly call return; after calling sendredirect().


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -