#3 Passing Query Paramater In REST API
Please go through series 1 and series 2 before starting this tutorial. In my last tutorials I have explained that how can we create simple hello world API and how can we access DB by using JDBCTemplate . JDBCTemplate is spring framework's library which make easy to access the DB. So now let me continue to the topic. Lets extends EmployeeDao to another method which will fetch Employee data based on email id passed. Please see the example below: Please note that I have added another method with email parameter. Now lets implement this method in interface implementation class ( named as EmployeeDaoImpl ): Now lets write REST api to access employee data with email passed. Write following method in your Controller class: We write another REST api names getemployee with request parameter email. I have used @RequestParam for parameter. You can make parameter as required OR optional . Now to access api you can call rest url as given below, by p...