At 07:57 PM 8/5/00 +0200, Guan Yang wrote:
>It seems that Python Server Pages, PSP, is an almost identical imitation
>of JSP. While this may be a good thing in getting acceptance, I (and,
>incidentally, others) don't think it is a "good" way of development.
>JSP, and related technologies such as PSP, PHP and ASP, are good in that
>they help developers creating sites where the content author or editor
>and the programmer are the same person. In that way, development is
>usually much faster.
>But when the content author/editor and the programmer are different
>persons, you begin to run into problems. The JSP way of solving this is
>to use beans. But notice that this still requires the JSP pages
>themselves to contain code, which can only confuse the content author.
You state "contain code" as being the problem. To me, code means things
like if-statements, loops, using variables, etc. If you are creating
dynamic web pages, it seems logically impossible to get around this.
PSP does go a long way to making it easier for content developers by
letting them work with the HTML while working around the code.
>I believe that inspiration for the "correct" way of implementing active
>page technology with a clear separation of code and content should come
>from FreeMarker (http://freemarker.sourceforge.net/) and, to a certain
>extent, from the ACS Dynamic Publishing System
We'll check them out.
>Personally, I think that FreeMarker is close to perfect, if only it got
>rid of that horribly complicated data model stuff, which really isn't
>necessary in Python anyway.
>FreeMarker uses a limited set of XML-like commands that content authors
>can use. They are all very simple and easy for the content people to
>understand and visualize. For example, conditionals:
Hey! That's an if-statement.
>Ways of iterating through a list:
><list aList as listElement>
> Some HTML that uses listElement...
And that's a loop!
>(equivalent to the Python for operator)
> <case value1>
> <case value2>
>And include tags:
>(equivalent of the PSP/JSP <%=)
And that's a variable!
Looks like programming to me. :-)
We chose _not_ to invent yet-another-language for Webware such as the one
you described above. In fact, several of us were displeased with DTML in
Zope. We just wanted to use Python. For us, that means no new language and
no new limitations. After all, Python is already easy to use.
However, PSP is stacked on top of WebKit. Consider that you have various
* Use straight Python servlets
* Use PSP
* Create a simple templating system
* Create your own server side HTML thingy complete with loops, etc.
PSP is in fact a plug-in for WebKit and you can create additional ones.
I personally have been using straight servlets with a simple templating
system. I also pull in "HTML fragments" and read content from config files
and CSV files. That way much of the web site can be changed without having
to know Python.
Currently I don't know of anyone that has plans to create the kind of
system you have described. If you would like to take a crack at it, you
will need to create a plug-in and a servlet factory. If you need help in
these areas, please let us know.