is forwarding a dopost or a doget by default?

576 views Asked by At

my simple question is:

by default, when i do request.getRequestDispatcher("\someUri").forward(request, response);

will it be a doPost or a doGet request? and what exacly does it depend on? (assuming i didn't make wrapper class.)

1

There are 1 answers

1
Pokuri On BEST ANSWER

doGet()/doPost() depends on your request 'METHOD' type. If it is GET then doGet(). If it is POST then doPost(). While doing forward you are passing same request as parameter. So, that same request METHOD type decides your forward type.