Hi guys. I have been using my web application with this include: <jsp:include page="/leftNavigation.jsp" flush="true"/> but now I'm getting this strange error: java.io.IOException: Error: Attempt to clear a buffer that's already been flushed. So, What I did was to increase the buffer size to 14kb: <%@ page buffer="14kb"%> and instead of using <jsp:include>, now I'm using <%@ include file="/leftNavigation.jsp"%> but the problem persists... any ideas ??
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
The preferred solution is to find the problem and fix it. Increasing buffer sizes is merely a work around (IMO etc) From my experience this problem is usually caused by an exception being thrown after the buffer has filled. If you keep the JSP code small and stable (MVC etc) it reduces this. If you can find the exception you can manage it and stop the problem occuring. (careful use of terminolgy: note that I didn't say 'handle' it. I'm not necessarily saying you should just put a try/catch around it) It also helps to get any scriptlet coding that might throw an exception done first. Not necessarily immediately useful, but I hope this helps. Dave
Joined: Nov 27, 2001
Thanks David. The problem was that in my servlet I was generating a token and was putting it in the request. In the jsp page I was checking the request and if the token was not there I was forwarding the request again to the servlet, so the token could be generated. But, I forgot that response.sendRedirect creates a new request, so I was losing my token... anyway... thanks for the tip. no need to resize the buffer
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com