Created a servlet context listener to init database, fixed a bug in login page and a bug in UserDetailsServiceImpl