ahh ok, We have ResponseFilter in wicket build in that do that. johan
On 7/19/07, jan_bar <[EMAIL PROTECTED]> wrote: > > Thanks for your care. I have a filter that appends some statistics > (request > processing time, date, ...) as comment to response of text/html content: > > final String stats = String.format("<!--%s (%d[ms])-->", new Date(), > responseTime); > try { > try { > response.getOutputStream().println(stats); > } catch(IllegalStateException e) { > // try writer > response.getWriter().println(stats); > } > } catch (IOException e) { > LOG.warn("Cannot write to response", e); > } > > -- > Jan Bares > http://jan.vegetband.cz > > > "Johan Compagner" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > i can remove the close() on it. > > But i am curious what you want to write afterwards > > because how do you know what to get the writer or the outputstream? > > because for the redirect strategy we just use the outpustream (bytes) > > instead of the writer (strings) > > > > and you can't use the output and the writer in one request. > > > > if you want to append or do stuff or replace stuff wicket has special > > support for that with IResponseFilters > > > > johan > > > > On 7/19/07, jan_bar <[EMAIL PROTECTED]> wrote: > > > > > > Thans for the answer, but I never said that > BufferedHttpServletResponse > is > > > handled by container. In my opinion, BufferedHttpServletResponse > should > > > not > > > call servletResponse.getOutputStream().close(), as pointed in my first > > > quesion. There can be other filters up the chain who want to write to > the > > > response. Besides that, wicket is incosistent. For instance > WebResponse > > > uses > > > httpServletResponse.getWriter(), but never calls close() on it. > > > > > > Regards, Jan > > > > > > -- > > > Jan Bares > > > http://jan.vegetband.cz > > > > > > > > > "Jean-Baptiste Quenot" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > * jan_bar: > > > > > > > > > > the ServletResponse javadoc doesn't state if and when one should > call > > > > > getWriter().close() or getOutputStream().close(). I have a filter > that > > > > > writes comments after the request was processed. Wicket sometimes > > > closes > > > the > > > > > response and sometimes not. For instance > > > > > BufferedHttpServletResponse.writeTo(HttpServletResponse > > > servletResponse) > > > > > calls: > > > > > > > > > > final OutputStream out = servletResponse.getOutputStream(); > > > > > out.write(this.byteBuffer); > > > > > out.close(); > > > > > > > > FYI BufferedHttpServletResponse is not directly handled by the > > > > servlet container, it is a wrapper around the real response for > > > > the REDIRECT_TO_BUFFER RenderStrategy. > > > > -- > > > > Jean-Baptiste Quenot > > > > aka John Banana Qwerty > > > > http://caraldi.com/jbq/ > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by DB2 Express > > > > Download DB2 Express C - the FREE version of DB2 express and take > > > > control of your XML. No limits. Just data. Click to get it now. > > > > http://sourceforge.net/powerbar/db2/ > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > _______________________________________________ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user