SendRedirect or request is sending more efficient?

SendRedirect or requestdispatch? Which should be preferable? Which is more efficient?

+3
source share
2 answers

They do two very different things, so you cannot just decide on effectiveness.

Sending a redirect will send the browser to a different URL. This URL will be displayed in the browser. You may or may not want this. For example, after a POST, you should probably redirect to a GET page to avoid reloading the results page without re-posting. On the other hand, you cannot redirect to "pages" that are accessible only inside the servlet container.

"" , , - (, , , ). , URL-, , , , . ( ServletFilter) .

, . POST ( , , ). .

+6

, , , sendRedirect, , .

, , , . -. , sendRedirect, - , , URL. , , , , . , .

0

Source: https://habr.com/ru/post/1704482/


All Articles