vendredi 26 juin 2015

Spring MVC realise a custom response for multiple controllers based on a variable

I have a couple of controllers, annotated with @RequestMapping like so:

@RequestMapping(value = "/group/{groupName}", method = RequestMethod.GET)
public ResponseEntity<List<Group>> getGroups(@PathVariable("groupName") String groupName) {...}

As a side note the requests and responses are (de)serialized with jackson.

Now those requests can only be handled if there exists a connection to another server. If that connection breaks I receive a notification and want to retry establishing the connection. While doing that I want to return status code 500.

What is the cleanest way to do so?

-- Thank you in advance.




Aucun commentaire:

Enregistrer un commentaire