You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2004/11/05 00:11:46 UTC
DO NOT REPLY [Bug 32033] -
Exceptions thrown during Servlet template merging
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32033>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32033
Exceptions thrown during Servlet template merging
dlr@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Additional Comments From dlr@apache.org 2004-11-04 23:11 -------
Clive, questions like this are best directed to the Velocity users mailing list.
Regarding #1, the error handler is the Right approach.
Regarding #2, my recommendation is to perform the processing of which you speak
_before_ merging template and context, and to provide objects in the context
which give access to your data (e.g. handles ResultSets).
Flush vs. buffer is controlled by the Writer you pass to Velocity. In this
case, that Writer is likely provided by your servlet container. Most servlet
container implementations allow use of the servlet API to buffer the response up
to a certain size instead of automatically flushing it. However, this would
still leave you with a bunch of garbage in your response buffer, so is not what
you're looking for here.
If you really want to buffer the response to avoid any half-baked responses, do
that in your application code -- using a StringWriter or something of the kind
-- instead of writing directly to the servlet's output stream. Please be warned
that this sort of buffering approach usually does not perform as well as a
streamed approach, and will not scale well.
Thanks for using Velocity. You know we like to hear users say it's better than
FreeMarker. ;)
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org