-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 4 Sep 2000, Randal L. Schwartz wrote:

> Nelson> And the first one has two major advantages: 1) requires less
> Nelson> code in the Perl modules and 2) allows designers to know how
> Nelson> Perl looks like.
> 
> Is this a codeword for "share our pain"? :)
> 
> Perhaps any HTML Template Comparison sheet should also show how to
> write a loop like that... I know Template-Toolkit would be a syntax
> somewhat in between the two, for example, while Mason would be more
> Perl-like.

I've been working with JSPs lately, and I'd use something like:

<jsp:useBean name="someIterator" type="java.util.Iterator">
<dadadada:iterator iterator="<%= someIterator %>">
  <table>
    <tr>
      <th>Name</th>
      <th>Address</th>
    </tr>
    <dadadada:iteratorLoop id="x" type="dadadada.someapp.SomeBeanClass" >
      <tr>
        <td><jsp:getproperty name="x" property="name" /></td>
        <td><jsp:getproperty name="x" property="address" /></td>
      </tr>
    </dadadada:iteratorLoop>
  </table>
</dadadada:iterator>

Which is close enough to HTML that the HTML people should understand it.
You never really have to "break character" while writing presentation
pages.  I prefer the custom tags approach to the embedded code approach..
See, in Java you're better off having a servlet set up the 'beans' for
the JSP, and then invoking the 'dumb' JSP to present them.  The logic is
in the servlet, and the JSP imports the results with useBean statements.
The designers never have to tiptoe around the logical work, they only
edit the JSP files.

That said, I am a mod_perl novice, and I don't know if there's anything
equivalent or better than this in the mod_perl world.

- --
"The Funk, the whole Funk, and nothing but the Funk."
Billy Donahue <mailto:[EMAIL PROTECTED]>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: pgpenvelope 2.9.0 - http://pgpenvelope.sourceforge.net/

iD8DBQE5s77o+2VvpwIZdF0RAtJPAKCRu9QU+Kqvib1ehQ/x1T4X/n3rGgCgm2AO
U5w8Hl8SrWK0jPV98QRNELA=
=6vfU
-----END PGP SIGNATURE-----

Reply via email to