On Mon, Dec 19, 2011 at 1:05 PM, KARR, DAVID <[email protected]> wrote: > In my relatively simple JAX-RS services, I return a Java object that's > serialized to XML or JSON. I typically don't set the HTTP status code. If I > remember correctly, if instead of just returning my Java object, I use a pure > "javax.ws.rs.core.Response" object I can set the status code, and set the > "entity" to the Java object I want to serialize. As far as I can tell, I > can't set the status code if I just return a java object. What is the best > strategy for returning an object AND setting the status code? Is it just > using the "Response" object as I described?
Yes. > > -------------- > David M. Karr > Senior Technical Architect, CDE Web Architecture > ATT Consumer Digital Experience > (425) 288-6027 work > (206) 909-0664 cell > > This e-mail, and any attachments, are intended only for use by the > addressee(s) named herein and may contain legally privileged and/or > confidential information. It is the property of AT&T. If you are not the > intended recipient of this email, you are hereby notified that any > dissemination, distribution or copying of this email, any attachments > thereto, and any use of the information contained is strictly prohibited. If > you have received this email in error, please notify me at 425-288-6027 and > permanently delete the original and any copy thereof. > >
