> -----Original Message-----
> From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 13, 2001 6:19 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Proposal: Support nested tags where only
> attributes can be
> used
>
>
> I dont really get what your saying. In your template (i.e.
> t.jsp) you define
> the formatting for the common look and feel of all your
> pages, for example
> page titles, a side bar and footers. If on some pages you
> don't need all of
> them you just leave them out - for example if you didn't need
> a footer then
> don't do a <template:get> for it on your jsp page - it still
> works fine.

Let me clarify a bit.  I expect to have two, maybe three, templates, for two
or three different types of pages.  For example, help pages will look
different than "regular" pages, administrator pages will look different than
regular-user pages, etc.  Within these page groups, I expect to have maybe
5-10 pages.  I wanted to avoid writing stuff like

  <template:insert template="t.jsp">
    <template:put name="pageTitle" direct="true">
       <bean:message key="login.title"/>
    </template:put>
    <template:put name="pageThis" direct="true">
       <bean:message key="login.this"/>
    </template:put>
    <template:put name="pageThat" direct="true">
       <bean:message key="login.that"/>
    </template:put>
    <template:put name="pageTheOther" direct="true">
       <bean:message key="login.theOther"/>
    </template:put>
    ...
  </template:insert>

for every single page when I could just define one thing for each page:

  <template:insert template="t.jsp">
    <template:put name="page" content="login" direct="true"/>
  </template:insert>

and have the template page "t.jsp" construct all the other items
dynamically.

HOWEVER, after thinking about it a bit, I've decided that maybe this
approach is too clever, because the stuff you end up doing, like

  <h1>Title is
    <bean:message>
      <bean:key>
        <template:get name="page"/>.title
      </bean:key>
    </bean:message>
  </h1>

isn't so easy to read, is it?  Perhaps the "wasted" effort of all those
<template:put>'s isn't so bad if you get a cleaner t.jsp file with
statements like

  <h1>title is <bean:message key="pageTitle"/></h1>

instead.

So, you're original suggestion of using

    <template:put name="pageTitle" direct="true">
       <bean:message key="login.title"/>
    </template:put>

actually solved the insurmountable problems I had, for which I thank you.  I
think I'll shelve my proposed enhancement for now, unless others are really
interested in it.


dean

> (deleted) ...

Reply via email to