I am getting casting exception while using delete .method of HTTP

13 views Asked by At

EXCEPTION ::"class java.lang.Integer cannot be cast to class java.lang.Boolean (java.lang.Integer and java.lang.Boolean are in module java.base of loader 'bootstrap')"

@RestController public class DeleteControllerForStudent {

@Autowired
StudentService stdService;


@DeleteMapping("/deleteStudent")
public void deleteByStudentName(@RequestBody Student student)
{
     stdService.deleteStudent(student);

}

}

This is my controller . If I am using postman for sending request .. how can I send name

localhost:8080/deleteStudentByName/{Tushar Joshi} This is how I was sending name but I am facing the above exception. Please reply !!

I tried deleting Student with single name localhost:8080/deleteStudentByName/{Urvashiii} I thought I was not sending name correctly . But I got the same exception again

0

There are 0 answers