On Fri, 7 Feb 2003, Mark Galbreath wrote:

> Date: Fri, 7 Feb 2003 14:35:18 -0500
> From: Mark Galbreath <[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
>
> 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:[EMAIL PROTECTED]]
> 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:[EMAIL PROTECTED]]
> > 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:[EMAIL PROTECTED]]
> > 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: [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