Is it possible in Spring MVC to have void handler for request?
Suppose I have a simple controller, which doesn't need to interact with any view.
@Controller
@RequestMapping("/cursor")
public class CursorController {
@RequestMapping(value = "/{id}", method = PUT)
public void setter(@PathVariable("id") int id) {
AnswerController.setCursor(id);
}
}
UPD
@Controller
@RequestMapping("/cursor")
public class CursorController {
@RequestMapping(value = "/{id}", method = PUT)
public ResponseEntity<String> update(@PathVariable("id") int id) {
AnswerController.setCursor(id);
return new ResponseEntity<String>(HttpStatus.NO_CONTENT);
}
}