Reputation: 11
Basically, I have some models which all use JAXB. However, I have some highly custom functionality to convert to JSON and back so I want to write my own MessageBodyReader/Writer to do the job for me.
Right now, the writing portion is done: if i return one of my models from a REST resource, it goes through my writer. But when I try and accept a model as a FormParam, it doesnt use my MessageBodyReader and instead attempts to unmarshal it using JAXB (which fails).
So how I can tell Jersey to use my Reader instead?
public TestModel testProvider(@FormParam("model") TestModel input){ //doesnt work
return new TestModel(); //this part works!
}
Upvotes: 1
Views: 1964
Reputation: 344
<init-param><param-name>com.sun.jersey.config.property.packages</param-name> <param-value> your.package.that.contains.the.provider </param-value> </init-param>
Upvotes: 1
Reputation: 149037
Since your writer works, but your reader does not, I'm guessing you have just missed something in your configuration. Some things to check:
Upvotes: 0