Hey Stephen,

When using tags, you always keep spacing between the tags. The body of a
c:forEach is often used for displaying output, so it has to output
everything between it's tags. In your case that's only whitespace and
newlines, but they still get output. What you might want to try is set
the page buffer size a bit larger, so that your computation can always
complete without flushing the buffer.

Try:

<%@ page buffer="sizekb"%> 

According to spec, size normally reads 8 making the buffer 8kb. Try a
larger size and see if that fixes the problem.

Grtz,

Martin

PS Put that statement at the top of your page...

> -----Original Message-----
> From: Stephen Letschin [mailto:[EMAIL PROTECTED] 
> Sent: donderdag 12 februari 2004 6:30
> To: Tag Libraries Users List
> Subject: RE: Problems with c:forEach and c:redirect
> 
> 
> You are correct that the code is only doing computation (or 
> at least that is all I want it to be doing). What I don't get 
> is if that is the case, why are there any newlines being 
> generated at all and shouldn't any that are be buffered and 
> not committing a response?
> 
> On Wed, 11 Feb 2004, Karr, David wrote:
> 
> > So the code above the redirect is only doing computation, 
> and is not 
> > intentionally generating output, correct?  You might have 
> to make your 
> > code look ugly to prevent emitting newlines.  As the number 
> of items 
> > you have to iterate through gets larger, the computation-only loop 
> > will be generating more newlines.
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, February 11, 2004 11:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: Problems with c:forEach and c:redirect
> >
> >
> > I am having a strange problem with the c:forEach tag in conjuction 
> > with c:redirect. I am using the Standard 1.0.4 taglib on a WebLogic 
> > 7.0SP2 container.
> >
> > The problematic code is below (sorry if it formats strangely in 
> > email). I save the various "roles" into a session-scoped variable 
> > named userRoles. It is a string and always starts with a 
> comma. If I 
> > have more than 21 roles in this string, any c:redirect I have below 
> > the code below refuses to work and I get a message in my logs about 
> > the response already being committed.
> >
> > Anyone have any ideas?
> >
> > --- Code Below ----
> >
> > <c:forEach var="userRole" items="${userRoles}">
> >     <c:choose>
> >         <c:when test="${userRole == 'DEVELOPER'}">
> >             <c:set var="accessDevGranted" value="TRUE" />
> >         </c:when>
> >         <c:when test="${userRole == 'SECRETARIAT'}">
> >             <c:set var="accessSecGranted" value="TRUE" />
> >         </c:when>
> >         <c:when test="${GroupAbbrevs.rowCount > 0}">
> >             <c:forEach
> >                 var="row"
> >                 items="${GroupAbbrevs.rows}"
> >                 varStatus="rowStatus">
> >                 <c:set var="fgl" value="FGL_${row.abbrev}" />
> >                 <c:set var="fgsl" value="FGSL_${row.abbrev}" />
> >                 <c:if test="${userRole == fgl || userRole == fgsl}">
> >                     <c:set var="accessFGGranted" value="TRUE" />
> >                     <c:set var="lead_count" 
> value="${lead_count + 1}" />
> >                     <c:set
> >                         var="lead_list"
> >                         value="${lead_list},${row.abbrev}" />
> >                 </c:if>
> >             </c:forEach>
> >         </c:when>
> >     </c:choose>
> > </c:forEach>
> >
> > --- End of code ---
> >
> > Stephen Letschin
> > [EMAIL PROTECTED]
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> >
> 
> --------------------------------------------------------------
> --------------
> Stephen Letschin                       "Life is hard -- Bring 
> your brain."
> [EMAIL PROTECTED]                                        
>  -- Jim Peak
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to