[jdom-interest] Dealing with binary characters in-memory ->outputter, Sample Code, Findings

Jason Hunter jhunter at collab.net
Wed Sep 26 10:25:37 PDT 2001


Elliotte Rusty Harold wrote:
> 
> At 9:08 PM -0700 9/25/01, Jason Hunter wrote:
> 
> >There's a BIG warning in the Javadocs about this.  Your writer wasn't a
> >UTF-8 Writer.  In the methods accepting a Writer it warns you have to be
> >DARN sure what you're doing.
> 
> Is it time to reconsider whether we even want to remove this method? 
> As I recall the big issue with removing it was that servlets only 
> gave you a PrintWriter to work with. However at least as of 
> version 2.2, the ServletResponse class does have a 
> getOutputStream() method that can be used instead of getWriter().

JSPs still only give you a Writer, and make it illegal to call
res.getOutputStream().  Lousy, but true.

> Less radically, we could mark the Output methods that take 
> Writers as deprecated, 

I think it's bad form to ship a 1.0 with deprecated methods.  IOW,
deprecated should not be used as a "warning" flag.

> Life would be a lot simpler if all writers had a getEncoding() method.

Agreed.  That's the right solution, if only we could change it.  :-) 
Has anyone checked for a bug in the Bug Parade?

-jh-





More information about the jdom-interest mailing list