开发者

Can we send or return char in java webservices using JAX-RS

I am new to webservices. I have some services which accept char as input parameter e.g char langPref etc. When I am trying to expose that service it is t开发者_运维技巧hrowing an exception. Can we send or return char in web services ?


Try to set an @Produces("text/plain") and return a String (cast from your char)

Likewise, an @Consumes should do the same trick for input.

(Having said that, you should probably emphasize the payload more. Just having chars as input/output is an indicator that your resource design is flawed)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜