Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?
Joe Hertz wrote: The old 'alternating-table-row-color' trick. No doubt there's a better way of doing that too. Thought about using the "one minus 1|0" trick? Initialize some int to 1 or 0: int index = 0; Then in your loop do: index = 1 - index; And set the color based upon some two element array based on index: color = colorArray[index]; I like that. Nice. Thanks for the reply Joe. -- bOOyah - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?
> The old 'alternating-table-row-color' trick. > No doubt there's a better way of doing that too. Thought about using the "one minus 1|0" trick? Initialize some int to 1 or 0: int index = 0; Then in your loop do: index = 1 - index; And set the color based upon some two element array based on index: color = colorArray[index]; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?
Curtis Taylor wrote: You're creating the bean "status" in the varStatus declaration in your c:forEach action. It's in scope in the loop as "status" already, so you don't need to re-initialize it. You can access its attributes inside your loop: ...etc. *sigh* You are, of course, correct. I could have sworn I tried that. I certainly swore. Just curious; what're you trying to do inside the loop? The old 'alternating-table-row-color' trick. <%-- set style for EVEN rows --%> <%-- set style for ODD rows --%> No doubt there's a better way of doing that too. Many thanks Curtis. -- bOOyah - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?
You're creating the bean "status" in the varStatus declaration in your c:forEach action. It's in scope in the loop as "status" already, so you don't need to re-initialize it. You can access its attributes inside your loop: ...etc. Just curious; what're you trying to do inside the loop? Curtis -- c dot tee at verizon dot net bOOyah wrote: It's killing me. Here's the snippet: [ServletException in:/pages/editscheduledetails.jsp] /pages/editscheduledetails.jsp(276,6) jsp.error.useBean.duplicate' org.apache.jasper.JasperException: /pages/editscheduledetails.jsp(276,6) My assumption in that the Jasper compiler thinks I have attempted to use a bean multiple times in the same scope or something. Here's the only piece of that JSP that uses a bean: Line 276: ... If I change "status" to "qwerty" it all works fine! The JSP books say that the 'varStatus' variable is local to the 'c:forEach' loop! How can I be declaring duplicate beans? I even added a scope="page" to the 'useBean' clause, but it made no difference. I'm not explicitly including other JSPs in this JSP...I'm using Tiles and Struts. Google only returns very scant info about 'jsp.error.useBean.duplicate' :-( Thanks for any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]