What happens internally when we use request.getRequestDispatcher?

Asked

Viewed 79 times

0

When we use the request.getRequestDispatcher() he does the forwarding of the request for another Let to be met (correct?). The question I wanted to know is: internally, it does this invocation (I don’t know if this is the correct term) of the other Serrvlet by a new HTTP request or is something like a method call?

  • 1

    Here is a good explanation: https://answall.com/questions/90410/qual-a-diferen%C3%A7a-entre-sendredirect-e-requestdispatcher-forward

1 answer

0

The entire process takes place internally without involving the client or browser. Visually we do not see the forwarded address, but an internal request occurs.

  • But how does this request happen between the servlets inside the server? Does it call a method? Or is it HTTP?

  • Yes, it forwards the request (http) to the other resource, which can be a Servlet, jsp or some other file.

  • Here is a good explanation: https://answall.com/questions/90410/qual-a-diferen%C3%A7a-entre-sendredirect-e-requestdispatcher-forward

Browser other questions tagged

You are not signed in. Login or sign up in order to post.