java - Spring RestController custom view resolver -
i've started implementing application using spring, , particularly making use of @restcontroller annotations. i've defined custom view resolver before normal controllers, i'm wondering how similar rest controller. i'm trying capture json before gets returned can pretty print it. i guess since it's not routing "view" view resolver wrong approach. should using? can use handlerinterceptor perhaps? how target @restcontroller annotated classes? your controller (most likely) ends returning object gets serialized json appropriate httpmessageconverter -- this one . as message converter writes json representation of returned object directly response output stream, need subclass mappingjackson2httpmessageconverter , overwrite writeinternal method chance apply custom logic around serialization. you'll need register custom converter instead of default 1 (or @ least before it). if post-processing can replaced customized serialization can h...