Some clients/servers may send requests/responses with no entity or an entity (for example WebDAV clients). To support such request or responses The EntityHolder
type may be used where the actual type of the entity is declared as a type parameter.
For example a POST method that consumes a specific JAXB object, MyJAXBObject
, can determine if the request contained the JAXB object or the request contained no entity, as follows:
@POST @Consumes("text/plain") public void post(EntityHolder<MyJAXBObject> s) { if (s.hasEntity()) { MyJAXBObject entity = s.getEntity(); } else { ... } }
@author Paul.Sandoz@Sun.Com
|
|
|
|