velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Locke" <plo...@abebooks.com>
Subject Effectively overriding the 'error()' function in VelocityServlet?
Date Fri, 20 Aug 2004 00:04:27 GMT
I find that any html written to the HttpServletResponse from the 'error()'
method if resulting from an exception from a template method call gets
appended after the portion of the template that was parsed before the
exception occurs.  For example if I call a method half way through my
template that throws an exception, the first half of the template will be
merged into the response, and then any html from the 'error()' method.  This
makes it seemingly impossible to present the user a nice error page.  I
assume this happens because the data is written immediately to the response
as it is merged.
 
 I have tried clearing the buffer of the response in 'error()', but it does
not work as it claims the response has already been committed, which makes
sense as the merge has sent the partially merged template to the client
already.  Suggestions?
 
--
Peter Locke
Senior Engineer
www.abebooks.com <http://www.abebooks.com/> 
 
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message