On Mar 8, 2009, at 2:21 AM, Erdinc Yilmazel wrote:
> I just wrote my first MessageBodyWriter. Unless I call the flush
> method on the Writer that I created using the entityStream in the
> writeTo method, I can't get any response from the server. It says the
> content length is 0 when I look at the response headers even though I
> set it to something else. If I call flush, everything works fine. Is
> this the expected behavior? The javadoc of MessageBodyWriter states
> that I should not close the output stream.
>
Are you wrapping the entityStream around a java.io.Writer instances?
for example, java.io.OutputStreamWriter ?
If so such Writer instances may buffer bytes, so calling flush on the
Writer will be required as this will write any buffered bytes to the
entityStream.
Paul.
> I am using Jersey 1.0.2 and deploying on Glassfish V3 Prelude.
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>