tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ricardo Rocha" <>
Subject RE: Multiple languages for Jasper
Date Tue, 19 Oct 1999 03:48:39 GMT wrote:
> I'd like to start work on implementing multiple language support for
>      - Parse the .jsp into an intermediate, language independent XML
>      - Use configuration parameters to decide which class is used to
compile a page
>        for a given language
>      - Each class needs to parse the XML intermediate doc, (generate
source & compile
>        if needed) to produce a class file.

This approach is similar to the one followed by polyjsp
where a javacc parser turns jsp tags into xml elements and collects
everything else as
text nodes. Xslt is then used to generate source code for a particular
language. Polyjsp
supports Java, Javascript (actually Fesi) and WebL but could be extended to
other languages as well. Polyjsp implements only a part of the 0.92 spec and
hasn't been
updated in a while, hoping to effectively contribute to Jasper instead of
becoming yet
another jsp implementation.

>      * Is XML a good choice? What about a bean instead?

I'd say Xml is _the_ choice. The recent evolution of Jsp shows a clear trend
towards Xml
as reflected by the introduction of the <jsp:> namespace (and thus the
possibility of expressing
any jsp page as a well-formed xml document) and, more recently, by the
addition of taglibs.

While the role of Xsl processing in Jsp is yet to be defined, it's clear it
holds promise in
providing, for instance, request-time browser customization by means of Xslt
This is an extremely important area: in its current state, Jsp only allows
for static html
generation with no explicit support for dynamic markup generation for
multiple browsers,
html/javscript versions or (what a waste!) dynamic html.

Cocoon ( provides a very strong case for
xml/xsl, though it also
exposes the problems of trying to make Jsp fully "xml-compliant" since many
a Jsp idiom results
in invalid xml (e.g. <element attribute="<%= expr %>"/>)

>      * How about interpreted languages (like Javascript)?

While some have questioned the use of interpreted languages in Jsp
(understandably because
of performance concerns), it's also true that easy-to-use and _specialized_
languages have a place
in servlet-based development. WebL, for one, provides very powerful markup
capabilities. As Java evolves and jit, hotspot or native compilation options
mature, ease of use
and power of expression will hopefully overcome fears of poor performance.

> One of the IBM people working on BSF popped up on the general list and
offered to integrate it
> into Jakarta, but I'll need that explained before I understand how it will

In my opinion, IBM's Bean Scripting Framework (BSF), along with BML (Bean
Manipulation Language),
offer a very appealing and powerful option for Jasper. Beyond supporting a
large number of
scripting languages (both compiled and interpreted including, yes dIon,
NetRexx) these frameworks
may also be used to implement taglibs in a very generic way. I'm very
excited about BSF being released
under a free-to-use, open source license. Question remains, though, if this
will include BML as
well; such combination will really kick ass!


View raw message