struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micael <caraun...@harbornet.com>
Subject RE: Rendering alternate rows of a table in Struts
Date Fri, 07 Feb 2003 21:13:17 GMT
That is, as they say, "WAY COOL".  Someone is thinking.

At 12:28 PM 2/7/03 -0800, you wrote:


>On Fri, 7 Feb 2003, Mark Galbreath wrote:
>
> > Date: Fri, 7 Feb 2003 14:35:18 -0500
> > From: Mark Galbreath <mark_galbreath@qat.com>
> > Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> > To: 'Struts Users Mailing List' <struts-user@jakarta.apache.org>
> > Subject: RE: Rendering alternate rows of a table in Struts
> >
> > Oh, and cutting and pasting tags is better?  With scriptlets, you need to
> > know one thing: Java.  With taglibs you must expand and juggle knowledge by
> > an order of magnitude.  Anybody who knows Java can understand a scriptlet;
> > the converse cannot be said of taglibs.
> >
>
>You are correct that designing correct tags in JSP 1.1/1.2 isn't all that
>easy.  However, folks will *really* like what is coming up in JSP 2.0 in
>this area -- in particular two interesting features:
>
>* A new tag invocation protocol (SimpleTag) that is so simple :-)
>   you almost can't get it wrong -- a single method call to implement,
>   and no worries about tag pooling or instance reuse.
>
>* Tag files, which allow a page author to point at a chunk of
>   JSP code (which might itself have tag invocations insode) and
>   say, in effect, "treat this chunk of stuff as a custom tag".
>   Now, page authors can create and reuse presentation-ish stuff
>   just as easily as Java programmers can reuse classes.
>
> > Mark
>
>Craig
>
> >
> > -----Original Message-----
> > From: Durham David Cntr 805CSS/SCBE [mailto:David.Durham1@scott.af.mil]
> > Sent: Friday, February 07, 2003 2:25 PM
> >
> > 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:mark_galbreath@qat.com]
> > > Sent: Friday, February 07, 2003 1:07 PM
> > >
> > > 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:Rob.Kischuk@Mentisys.com]
> > > Sent: Friday, February 07, 2003 11:13 AM
> > >
> > > > 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
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org



LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message