Skip to content
Advertisement

Why users are not displayed from the database?

I can’t get a list of users from the database.I am assuming userService.allUsers () = null. But why? I have no idea. Since there are users in the database. Please tell me what is wrong with my code? It does not give me any errors in the logs. AdminController

JavaScript

Class UserService

JavaScript

ForAdmin.html

JavaScript

I do not even understand why nothing is written to me in the logs, as if the data does not reach thymeleaf.Tell me what is wrong with my code?

Advertisement

Answer

Actually i might already know what your problem is – you have defined the endpoint forAdmin twice: once at class level and once again with @GetMapping. The resulting endpoint is localhost/forAdmin/forAdmin and of course if you have been using localhost/forAdmin the endpoint wouldn’t get loaded

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement