Spring MVC Hibernate MySQL – Multiple Controllers

Spring MVC Hibernate MySQL – Multiple Controllers:
In our previous example we implemented Spring MVC Hibernate MySQL CRUD Operations (Here). In this article we are going to see how to use Multiple Controllers using Spring MVC.

In the below example, We are going to create 2 entities Employee and Manager and will have separate controllers for both these entities. Let us see how to add, view and delete. Edit operation is same as we discussed in previous example (Here), So i have not implemented Edit operation in this example.

Project Structure:

POM.xml

com.javainfinite.model:
Employee.java

Manager.java

com.javainfinite.dao:
EmployeeDAO.java

ManagerDAO.java

EmployeeDAOImpl.java

ManagerDAOImpl.java

com.javainfinite.service
EmployeeService.java

ManagerService.java

EmployeeServiceImpl.java

ManagerServiceImpl.java

spring-config.xml

web.xml

employee.jsp

manager.jsp

Output:

After Adding,

Deleting Employee,

On Clicking Manager Link,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *