Jack Humphrey wrote:

>My reading of the JSP 1.0 spec is that there are three kinds of
>server-side includes:
>
>1. Translation-time inclusion: <%@ include file="relativeURLspec" %>
>Content is included when JSP is translated into a servlet. Included
>content can be JSP.
>
>2. Request-time static inclusion: <jsp:include file="urlSpec">
>Content is included when request is made. Allows you to dynamically change
>which file is included. Included content is not parsed as JSP.
>
>3. Request-time dynamic inclusion: <jsp:request include="urlSpec">
>Dynamic content is included when request is made. This is equivalent to
>the callPage method from previous specs/implementations. Maps to
>RequestDispatcher.include in JSDK 2.1. Included content is parsed as JSP.

Is it just me, or does anyone else think that having three different
syntaxes for doing file inclusion is needlessly confusing? Given that
file inclusion is an important element of JSP, why not unify the syntax
into a single element that uses attributes to make the distinctions more
explicit?

For example:

<jsp:include file=<urlSpec> phase=<phase> content=<content> />

where <phase> is either "translation" or "request" and <content> is
either "static" or "dynamic".

This actually introduces a fourth type of inclusion not covered by the
existing tags (i.e., translation-time static inclusion), but I think I'm
on fairly safe ground arguing that the time of the inclusion and the type
of the included contents are orthogonal to one another.

The only downside of a unified syntax that I can see right now is that
the value for the "file" attribute can be a request-time attribute value
when phase="request", but not when phase="translation". This could be a
bit confusing to novice JSP authors, but I think it would be less
confusing in the long run than the current syntax(es).

- Mark

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to