Target:
we need to delete the employee information who wants to delete and do not display on the screen anymore.
What you need:
First, we need to edit out list.html which means we need to add a specific code on suitable way.
Second, we need add a method which named deleteEmp in the EmployeeController class.
The details:
First,we need to add this code on this suitable place. the meaning is same as the passage which introduced the update-opration.
!!! by the way we need to pay attention on the mark a (<a>) if you set as the default <button> . That means it can not transfer any of values to the controller class. and you will find when you click the button you will receive nothing and there is no mistake will show on the console.
Second, according to the marks what we set(@{/delemp/})+(${emp.getId()}) we can type our method in the EmployeeController class.
as a usual, we can use the annotation @PathVariable("arg") to receive the argument what we set at the list.html. and then we just need to dispatch the based method the delete the details.
so we can see the employee has totally been deleted!!!