That is a good question. I am running TomCat. I have a number of
objects that I wrote for perl that handle navigation. The html would
reside in a database, and my navigation handler would gather naviation
tree from the database. I can of course output html, and I can put all
kinds of tags to be processed by the servlet.
When you write "tags to be processed by the servlet" you make me think
you are either
1) making things more difficult than they need to be, or
2) misunderstanding how servlets and JSP work.
A typical servlet front-end for a database-driven website would collect
appropriate HTML snippets from the database (based on some local logic)
and construct a complete HTML page from them, perhaps with the addition
of some HTML code chosen by the servlet itself at request time.
_Modifying_ the HTML fragments from the database at request time based
on special tags in the HTML code would be roughly equivalent to
server-side includes, but what would be the point of that when you're
already running in a servlet container? A more common paradigm would be
to write the pages as JSPs (residing locally on the server), with custom
tags and (plain) JavaBeans encapsulating the server-side logic,
including DB lookups.
At this point I would like to convert those perl objects to Java, have
my objects handle all the navigation. Perhaps I am totally
misunderstanding JSP, and I need to start from the ground up.
It seems that the natural conversion would be from your Perl objects to
JavaBeans that provide similar functionality. These would be usable
whether you write the application with JSP or only with "pure" servlets.
If you do use JSP then you might find it useful to create custom
tags around some of the beans' features, but custom tags are a nicety,
not a requirement.
I repeat an important point from an earlier post that you may have not
fully appreciated: it is *abnormal* for JSP code to be interpreted by a
servlet container in the process of handling any specific request. The
JSP code is translated to Java source for a servlet and compiled at
need, but usually such need only manifests the very first time the JSP
is accessed after its deployment (if even then).
John Bollinger
(e-mail address removed)