Class LoginHandler

java.lang.Object
   |
   +----javax.servlet.GenericServlet
           |
           +----javax.servlet.http.HttpServlet
                   |
                   +----LoginHandler

public class LoginHandler
extends HttpServlet
This class gets the form data and compares the crypted password for the user with that stored in the Server Database and sets a cookie at the browser end, at the same time storing it with the Server, if the user has authenticated himself.If the authentication fails then a mail is sent to the user, so that he can know of any attempt


Variable Index

 o myCom
 o passwd

Constructor Index

 o LoginHandler()

Method Index

 o allowUser(String, String)
 o CommonFunc(HttpServletRequest, HttpServletResponse)
 o doGet(HttpServletRequest, HttpServletResponse)
This method handles data received when secure method is used, the password is already crypted and it just invokes the CommonFunc method.
 o doPost(HttpServletRequest, HttpServletResponse)
This method handles data received when insecure method is used, the password is crypted and the CommonFunc method is invoked.For crypting it uses the getChallenge method of the PassField class.
 o UserEmail(String)

Variables

 o passwd
 public static String passwd
 o myCom
 public static Connection myCom

Constructors

 o LoginHandler
 public LoginHandler()

Methods

 o doGet
 public void doGet(HttpServletRequest req,
                   HttpServletResponse res) throws ServletException, IOException, IllegalStateException
This method handles data received when secure method is used, the password is already crypted and it just invokes the CommonFunc method.

Overrides:
doGet in class HttpServlet
 o doPost
 public void doPost(HttpServletRequest req,
                    HttpServletResponse res) throws ServletException, IOException, IllegalStateException
This method handles data received when insecure method is used, the password is crypted and the CommonFunc method is invoked.For crypting it uses the getChallenge method of the PassField class.

Overrides:
doPost in class HttpServlet
 o CommonFunc
 public void CommonFunc(HttpServletRequest req,
                        HttpServletResponse res) throws IOException
 o allowUser
 protected boolean allowUser(String user,
                             String passwd) throws SQLException
 o UserEmail
 protected String UserEmail(String user) throws SQLException