- To get the actual parameters of the database tables, run script from the resources/init_db.sql file in the Workbench.
- Add two more fields (
loginandpassword) to yourDriverclass. We will simplify the task, and our Driver will behave as User. - Modify the required JSP pages and corresponding controllers to support two new fields:
loginandpassword. - Modify
DriverDaoImplandCarDaoImplto fetch all columns for drivers, including new ones. - Create new AuthenticationService with method
Driver login(String login, String password); - Create new method
Optional<Driver> findByLogin(String login)in DriverDao and DriverService. - Use your new method findByLogin in the
authService.login(login, password)method to identify the user based on the login - Implement
LoginControllerwith corresponding JSP page - Implement
LogoutControllerand add a corresponding button on all pages where it should be - Implement user authentication based on HttpSession and filters. Only
LoginControllerandCreateDriverControllershould be available for non authenticated users. - Having information about currently logged-in user (e.g. driver), please implement the following controller
GetMyCurrentCarsController. This controller is responsible for displaying the list of cars for currently logged driver (get info about the driver from the HttpSession). Hint: Use existed JSP page for displaying all cars.
You can check yourself using this checklist