[jdom-interest] Failing early on maxLength violations

J. McConnell jdotmc at gmail.com
Wed Dec 14 06:32:11 PST 2005

On 12/14/05, Tatu Saloranta <cowtowncoder at yahoo.com> wrote:
> It may be that even before the SAXBuilder gets access
> to data, servlet (or whatever is used on server side)
> may have already buffered it in memory, so you may
> want to verify that aspect of upload (assuming you use
> upload form element).

I've been testing at the command line with telnet at this point, so I
know that the exception isn't thrown until I actually type out the
closing tag and hit enter.

> On the other hand, most SAX parsers do send text
> content in chunks, so you could override
> SAXHandler#characters() method, and do checks when it
> tries to append characters in the StringBuffer()
> object.

I'll look into this, thanks.

> And I guess adding support for such limits
> would be fairly easy to do as a general feature (just
> need to either override createContentHandler() in
> SAXBuilder, or make
> it configure handler instance with max length
> indicator).

Where would be an appropriate forum to request this or offer help
implementing it?

Thanks for your help, I appreciate it.

- J.

More information about the jdom-interest mailing list