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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -