- Download and import the project inside the DependenciesInjection folder.
- Create a new Java class StudentServiceImpl that implements the StudentService interface.
- Implement the methods of the StudentService interface using an ArrayList as the internal data structure:
public interface StudentService
{
void add( Student student );
void delete( Student student );
List<Student> all();
Student findById( String id );
}
- Annotate the StudentServiceImpl with the @Service annotation.
- Add a method inside the StudentServiceImpl that is called inside the constructors that add some test students.
- Start your server by running the project on the main on the DependenciesInjectionApplication class.
- Verify that your implementations work by passing an existing id into the url and checking that student data is displayed in the browser.
http://localhost:8080/student/10