In the LoginController we have to modify the validation logic to use the service class for validating the user. LoginController class:
For creating full login site we should add Hibernate and MySql driver dependencies in pom.xml file. Another thing is to add applicationContext.xml file for initializing Spring and Hibernate related components. For example bean definition for MySQL dataStructure and sessionFactor which will be used in DAO classes.
Thera are also a few changes in: web.xml: