Use
List<String> list = new ArrayList<String>();
GenericEntity<List<String>> entity = new GenericEntity<List<String>>(list) {};
Response response = Response.ok(entity).build();
The Generic entity wrapper works to get the output when using the Response builder.
More Related Contents:
- MULTIPART_FORM_DATA: No injection source found for a parameter of type public javax.ws.rs.core.Response
- POST to Jersey REST service getting error 415 Unsupported Media Type
- Jersey 415 Unsupported Media Type
- How to access parameters in a RESTful POST method
- Using JAXB to unmarshal/marshal a List
- Using JAXB to cross reference XmlIDs from two XML files
- what’s the correct way to send a file from REST web service to client?
- Stax XMLStreamReader check for the next event without moving ahead
- JAXB: How should I marshal complex nested data structures?
- @XmlPath has no impact during the JAXB Marshalling
- MessageBodyWriter not found for media type=application/json
- FileUpload with JAX-RS
- How to serialize Java primitives using Jersey REST
- How do you customize how JAXB generates plural method names?
- How to test a Jersey REST web service?
- Jersey: Return a list of strings
- HTTP 500 Internal Server Error in simple REST based program. Confused in GET and POST while receiving/sending response from server
- no suitable HttpMessageConverter found for response type
- JAXB inheritance, unmarshal to subclass of marshaled class
- How to marshal without a namespace?
- Java/JAXB: Unmarshall XML attributes to specific Java object attributes
- Passing custom type query parameter
- Using StAX to create index for XML for quick access
- Use JAXB to create Object from XML String
- javax.xml.bind.UnmarshalException: unexpected element (uri:””, local:”Group”)
- How should I log uncaught exceptions in my RESTful JAX-RS web service?
- Where I can find a detailed comparison of Java XML frameworks? [closed]
- Jaxb: how to unmarshall xs:any XML-string part?
- Java XML Binding [closed]
- Optional params in REST API request using Jersey 2.21