Hans Bergsten wrote:

> That's as close as you get in JSP 1.0. In JSP 1.1 there are ways to pass
> parameters to the included servlet (as a query string on the page URI or
> using <jsp:param> actions).
>
> But you may also like to analyze your design and see if the included
> servlets really need to be servlets at all. A servlet is not meant to be
> a general purpose component, it's role in life is to process requests.
> You may want to see if it's better to redesign your included servlets into
> JavaBeans or utility classes (works in JSP 1.0) or custom actions (works
> in JSP 1.1).

That's one point of view, but I think it's arguable. I still admire ATG's Dynamo
product (I'ld be using it, except management didn't want to use a propietary
technology). Dynamo provides an embedded-Java HTML generation system like JSP, except
that it is based entirely on using servlets as components.

It includes only a handful of special tags, (DROPLET, OPARAM, ...), and flow of
control is provided not by custom tags, but by special-purpose servlets (called
droplets).

For instance, this snippet displays names from an array of "person" objects.

<droplet bean="ForEach">
    <param name="array" value="bean:personList">
    <oparam name="output">
        <!-- On each iteration, element will be one of the "person" objects on
                peopleList -->
        <p><strong>Name: </strong><valueof param="element.name">
        </p>
    </oparam>
  </droplet>

In some ways this strikes me as more elegant than that of the JSP approach. The
"oparam" concept is particularly powerful. The oparam element can contain arbitrary
HTML, which is passed to the containing droplet, to handle as it wishes.

I keep fantasizing about having a spare week or two to see if droplets and oparams
could be implemented with JSP 1.1 custom tags.

Yours, JonTom

    JonTom Kittredge
    ITA Software, Inc.
    Cambridge, Massachusetts.

> --
> Hans Bergsten           [EMAIL PROTECTED]
> Gefion Software         http://www.gefionsoftware.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to