It's not in the view layer. We segregate our controller JSPs from our view JSPs. So you will change your argument to say that we should not use JSPs at the control layer, and of course _most_ of our control logic is in pure Java, but there are cases where having our controller logic written in JSTL (and separated from other model/view JSP pages) is a substantial advantage for us.

So the question still stands, is there a global way to change the commit point so we don't have to constantly reset a connection to clear the buffer?

Aaron


On 3/25/2010 10:02 AM, Jon Stevens wrote:
This is why you don't put application logic into the view layer. Before you 'push' your data into the view, figure out if you want to do the redirect or not.

jon

On Thu, Mar 25, 2010 at 7:49 AM, Aaron Freeman <aaron.free...@layerz.com <mailto:aaron.free...@layerz.com>> wrote:

    We take some fairly lengthy queries (lengthy row based on row
    count), and push the data into hashmaps in JSTL pages.  After that
    sometimes we evaluate the hashmap and sometimes have to redirect
    the request to another page.  In 3.0.23 it works with no
    problems.  In 4.0.5 we get "java.lang.IllegalStateException: Can't
    sendRedirect() after data has committed to the client."

    The reason being, that the for loop is causing a ton of white
    space to be sent to be buffered up, and at some point a buffer
    size limit has been hit with only whitespace, causing Resin to
    then send the HTTP headers and commit the request.

    So in the for loop I can do this to "fix" the problem:

    <c:forEach items="${requestScope.getRewriteUrlsQuery.rows}"
    var="rewriteUrlsQuery">
    <% response.reset(); %>
        ....
    </c:forEach>

    The question is, is there a setting in the resin.xml where I can
    change the buffer size globally, or do we have to go to modify all
    JSPs that potentially have this problem?  Was the default commit
    point changed between 3.0.x and
    4.0.x, or some other architecture change, as we have never seen
    this until now?*
    *
    Thanks,

    Aaron*
    *


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to