[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

GNUJSP: Multiviews cont'd, design proposal


Carsten Heyl wrote:

> We have different jspURIs we use to locate the page object
> which all use the same jsp files but generate different
> servlets ...
> I think the mapping jsp file <-> jsp servlets shoule be one to one
> to we would need to
>
>         - store jsp pages by jspURL
>         - generate servlet names (again, sigh :-( by using
>           the jspURL.
>
> I didn't like the second but I didn't see a way to avoid that.
> Servlet names will get longer and will contain info about
> the local file systenm path which I would like to hide.
>
> Opinons?

Carsten, I think your approach is sound.  I would be interested in seeing how
Jakarta handles or plans to handle these mappings.  Does anyone have it
running for comparison?

One note: we should be careful not to assume that jspURL is of type "file:".

We still need better documentation for what happens in all the URI/URL related
methods.  Most now use JspParserContext (which is now something of a
misnomer).  I was thinking of moving that code to something like
"PathTranslator.java".

A somewhat radical approach: change to a pluggable architecture where we
detect the servlet engine (by context info or initArgs) and dynamically load a
PathTranslator for that engine (e.g. JServPathTranslator,
JigsawPathTranslator, VQServerPathTranslator).  This would make the code
infinitely more readable, but would not be as generic of a solution (it would
require us, or the servlet engine author(s), to provide an implementation of
PathTranslator for each engine.)  On the other hand it would make the code run
faster too.

Thoughts on that approach?

Wes