I don't mind using JSP's for some of the (separated) control logic. For
example, you have a form action:

<form action="email_confirm_submit.jsp">

Inside of it, it looks like this:


That said, look at that code. The logic for determining the next page to
redirect to is either in the <t:action> or within the JSTL within the
email_confirm_submit.jsp. Generally, it is nice to have it in JSTL because a
UI person can change the location of the final page without having to modify
java code to do so.

The point being that by the time you get to the view layer (ie: a jsp that
doesn't have _submit.jsp at the end), you don't do a redirect. You are
depending on what is effectively a bug in Resin that has now been fixed in a
newer version. You should modify your code to change that dependency because
you can (and should) be doing it differently.


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

>  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>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
resin-interest mailing list

Reply via email to