Issue
Method in controller
@RequestMapping(value = "/reactEmployee", method = RequestMethod.POST, consumes = "application/json")
public String addEmployeereact(@RequestBody EmployeeEntity employeeEntity)
{
employeeManager.addEmployee(employeeEntity);
return "redirect:/";
}
Json input from Postman Json input and 415 error in Postman
Solution
After looking at github link I found that jackson
needs to be specified in pom.xml
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.1</version>
</dependency>
Answered By - Bilal Shah
Answer Checked By - Katrina (JavaFixing Volunteer)