0
Im SpringBootアプリケーションには、いくつかのケースを処理するRESTコントローラがあり、これらのケースの1つは別のコントローラに転送する必要があります。Spring ResponseEntity and forward
@PutMapping(
value = "/rest/endpoint",
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<CustomObject> doPut(@RequestBody myDataToBeHandled) {
if(caseAHolds(myDataToBeHandled){
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
}
else if(caseBHolds(myDataToBeHandled){
return new ResponseEntity<>(null, HttpStatus.OK);
}
else if(caseCHolds(myDataToBeHandled){
// Redirect here
}
}
私はリダイレクトでこれを行う方法についてはan exampleを見ましたか?別のURLに要求をリダイレクトするために、以下に示すように、以下に示すよう