Taglibs aren't just useful to people working with HTML, they are a great way to reuse 
logic in JSP's.  Cutting and pasting scriplets IMO is not.

-Dave

> -----Original Message-----
> From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 07, 2003 1:07 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Rendering alternate rows of a table in Struts
> 
> 
> Well, let's be honest, dude.  The great idea behind taglibs 
> in the first
> place was to allow non-developers such as HTMLers and graphic 
> artists to be
> able to manipulate content without understanding a 
> programming language and
> keep real programmers (yes, I have a definition, if you are 
> interested) from
> having to maintain the presentation layer.  Now, from that 
> perspective, look
> and my example and look at yours.  Which is going to be clearer to a
> non-programmer?
> 
> Otherwise, look how complex using a taglib is to integrate into an
> application, to say nothing of what it takes to develop a 
> custom taglib
> (I've done it).  I may sound like a heretic, but in my mind, SIMPLE
> scriptlets are better than a tag to do the same thing - from 
> development,
> integration, and maintenance perspectives.
> 
> Mark (they don't call me Chief Eating Crow for nothing) Galbreath
> 
> -----Original Message-----
> From: Rob Kischuk [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 07, 2003 11:13 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Rendering alternate rows of a table in Struts
> 
> 
> > That's all well and good but what happens when the author no longer
> supports
> > it, technology moves on, and somebody behind you has got to 
> maintain 
> > it? Doing it with scriptlets is as easy as
> >
> > <% int count = 0 %>
> > <logic:iterate . . .>
> >   <% if( count % 2 == 0 ) { %>
> >     <tr bgcolor="coral">
> >       <td></td>
> >   <% } else { %>
> >     <tr bgcolor="fuscia">
> >       <td></td>
> >   <% } %>
> >   </tr>
> >   <% count++ %>
> > </logic:iterate>
> >
> > What could be simpler and clearer?  This methodology is 
> much easier to 
> > maintain than some esoteric third-party tags.
> 
> <c:forEach var="currItem" items="${myCollection}" varStatus="info">
>   <c:if test="${info.count % 2 == 0}">
>      <tr bgcolor="coral">
>   </c:if>
>   <c:if test="${info.count % 2 == 1}">
>      <tr bgcolor="fuschia">
>   </c:if>
>     <td>blah blah</td>
>   </tr>
> </c:forEach>
> 
> Simple. Clear. Standard.  The logic is plain, JSTL isn't 
> going to have the
> maintenance issues you mention, and there's no nasty 
> scriptlet delimiters
> muddling the mix.
> 
> -Rob
> 
> -----Original Message-----
> From: Michael Lee [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 07, 2003 10:52 AM
> 
> There are a couple of you can't do it posts. We did it with a 
> jsp tag. One 
> of my co-workers found one on the web. Look around. There is 
> a freeware/open
> 
> source one out there he found. He may have modified it some. 
> It is very 
> possible. We did it. Sorry I can't be more help but I don't 
> know the URL.
> Mike
> 
> >From: Justin Ashworth <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: Rendering alternate rows of a table in Struts
> >Date: Fri, 07 Feb 2003 09:50:36 -0500
> >
> >You can do it quite easily with JSTL...
> >
> ><c:forEach var="row" items="${tabledata}" varStatus="info">
> >
> >    <c:set var="tdclass" value="blue-row"/>
> >    <c:if test="${info.count % 2 == 0}">
> >       <c:set var="tdclass" value="red-row"/>
> >    </c:if>
> >
> >    <td class="<c:out value='${tdclass}'/>">Data</td> </c:forEach>
> >
> > > -----Original Message-----
> > > From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 07, 2003 9:35 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: RE: Rendering alternate rows of a table in Struts
> > >
> > >
> > > No.  You have to use a scriptlet.  But remember - philosophical
> > > purity should always yield to pragmatism.
> > >
> > > Mark
> > >
> > > -----Original Message-----
> > > From: Ritesh Singhal [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 07, 2003 9:19 AM
> > >
> > > I am using logic iterate tag to iterate over a collection and
> > > display the contents of the collection in the form of a table. I 
> > > want to render the alternate rows with different 
> background colours. 
> > > I don't want to use scriptlet for finding the row number 
> and set the 
> > > colour. Is there any Struts tag where I can specify such 
> > > functionality.
> > >
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > 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]
> 
> 
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online  
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> ---------------------------------------------------------------------
> 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]
> 
> ---------------------------------------------------------------------
> 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]
> 
> 

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

Reply via email to