java - JAX-RS — How to return JSON and HTTP status code together? - Stack Overflow
Improvement: After finding another related answer, I learned that one can inject the HttpServletResponse
as a member variable, even for singleton service class (at least in RESTEasy)!! This is a much better approach than polluting the API with implementation details. It would look like this:
Read full article from java - JAX-RS — How to return JSON and HTTP status code together? - Stack Overflow
No comments:
Post a Comment