I have a simple form which accepts a username and a password. I have to use sendRedirect() method for the page to redirect to one page if log in is valid and to
sendRedirect()
No, a HTTP redirect will always use GET for the target page.
However, POST data are not much safer than GET data anyway. The user can still tamper with them. Store them in the session instead.