Register MessageBodyWriters and Readers to Wink
-----------------------------------------------
Key: AMDATU-444
URL: http://jira.amdatu.org/jira/browse/AMDATU-444
Project: Amdatu
Issue Type: New Feature
Reporter: Paul Bakker
It should be possible to register new providers of MessageBodyWriters/readers
to Wink. Normally you would do this by extending the standard JAX-RS
"Application" class or by scanning for @Provider classes. This required to work
with libraries such as Jackson for JSON processing.
For example:
{code}
public class ContactInfoApplicaiton extends Application {
public Set<Class<?>> getClasses() {
Set<Class<?>> classes = new HashSetSet<Class<?>>();
classes.add(ContactInfoWriter.class);
classes.add(ContactInfoReader.class);
}
public SetSet<Object<?>> getSingletons() {
// nothing to do, no singletons
}
}
{code}
Wink has a few additional methods to register providers:
http://incubator.apache.org/wink/1.0/html/5.1%20Registration%20and%20Configuration.html#5.1RegistrationandConfiguration-ProviderPriorities.
This doesn't work now because we bootstrap the wink servlet from code without
doing anything with providers etc.
The workaround is to do the json processing in the resource method and return
the result as a String. This is ok, but not how it's suppose to work in JAX-RS.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
http://jira.amdatu.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Amdatu-developers mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-developers