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:
For Energy Billing System I want to add login screen for the user that will be displayed before access to user panel. The user can enter username and password, click submit button to proceed the login. For this purpose, I create a simple database in mysql.
Create a table called: users, by using fallowing sql:
Checking information about table that we created:
Added two records into users table:
Now in a database, we should have two records. Next step is to create a model class. This Entity is mapped to the “users” table.
Created DAO class interface:
For now is a small part of login implementation. In the next post, I will present complete implementation.
For the last few days, I have not had time to work on the project. Now there is simple page displayed as an initial project page.
Added spring framework dependencies in pom.xml file:
Created dispatcher servlet configuration:
The picture above presents the basic appearance of the page that will appear after run changes. For now, there are not many changes, but it is a necessary attitude to make new changes and work on the application.