I dont know what is wrong in my listContacts in controller
map.put(\"contactList\", contactService.listContact());
Can somebody help me?
It looks like a NullPointerException thrown in the method here:
@RequestMapping("/contact")
public String listContacts(Map map) {
map.put("contact", new Contact());
map.put("contactList", contactService.listContact());
return "/contact";
}
I would debug and check that contactService has been autowired correctly.
The null pointer is line 26, if that is the line containing contactService.listContact() then contactService is null. If it is the line above then the map is null.
I am not sure but try adding:
to the dispatcher-servlet.xml as well, it could be that the annotation isnt getting processed