java - Spring HttpMessageConverter for only one Controller? -
i'm aware of , comfortable using spring message converters automatically convert objects controller returns into, e.g. json. however, haven't been able find information applying particular message converter only one of several controllers in app.
basically, have 1 particular piece of app show audit log entries, , ever viewed admin, doesn't need pretty. i'd write quick httpmessageconverter takes list<auditentry>
, returns string html table of entries, else in app user-facing , gets sent on json. possible? didn't see mention of in docs read. if is, what's magic xml?
the @requestmapping
anotation has produce
produces producible media types of mapped request, narrowing primary mapping.
so in case of json have in produce
- "application\json"
when want return html can use "text\html" , use modelandview
of spring-mvc
Comments
Post a Comment