I have a Login-page (a JSP) in which the user enters the username
and password. The JSP is submitted using METHOD=“POST”. In the
servlet I have all the logic written in the doPost() method, the
doGet() method just forwards the control to the doPost method. After
the user credentials are validated in the doPost method the user is
fwded to a different JSP, if not then the same login page is
displayed. The problem is that once the doPost method has been
executed the doGet is being called automatically (so doPost is being
called 2 times, once by the request and once by doGet), the second
time a NullPointerException is thrown (since there is no
username/pwd to validate).
I am confused as to why doGet is being called automatically!