This is happening due to the @Controller annotation. By default controller annotation return the view in spring. If your application is getting and returning json better to use @RestController annotation that is return json response by default
@RestController
public class UserController {
@Autowired
private UserService userService;
@PostMapping("/user/add")
public void addNewUser(@RequestBody User user) throws BLException {
userService.addNewUser(user);
}
}