I'm writing a postback handler library for a service that has some odd JSON mapping practices. I can very easily configure a custom Jackson ObjectMapper
to handle the mapping, but if I register a Spring MVC message converter with that mapper, it applies the mapping (which is incorrect for the rest of the JSON I'm dealing with) to all incoming requests.
There are a handful of manual approaches I can apply to hand-decode these messages, but it would be much cleaner to have the Spring type-conversion service handle it in the request pipeline.
Is there a feasible way to attach a custom message converter to a specific controller, handler method, or mapping string/template/prefix?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…