I have Java controller:
@RequestMapping("tep")
public class TepController {
private final TepRepo repo;
@Autowired
public TepController(TepRepo repo) {
this.repo = repo;
}
@GetMapping
public List<Tep> list(){
return repo.findAll();
}
@PostMapping
public Tep create(@RequestBody Tep tep){
return repo.save(tep);
}
@GetMapping("{id}")
public Tep getOne(@PathVariable("id") Tep tep){
return tep;
}
@PutMapping("{id}")
public Tep sent(@PathVariable("id") Tep tepFromDb,
@RequestBody Tep tep){
BeanUtils.copyProperties(tep, tepFromDb, "id");
return repo.save(tepFromDb);
}
@DeleteMapping("/{id}")
public void delete(@PathVariable("id") Tep tep){
repo.delete(tep);
}
}
And ran into the following problem: WARN 14068 --- [nio-8080-exec-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'DELETE' not supported] It happened when I send DELETE request, but others requests work good
Thank for answers)