tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Kogan <>
Subject Re: Design Opinion
Date Wed, 24 May 2000 22:05:59 GMT

Why don't you want make your portlets as regular java classes.
You may "populate" them by name using Class.forName(). Also
you may
encode class names as hidden parameters in forms.

All data can be stored in Hashtable, then pass Hashtable as
parameter for all classes. More over you can inherit all
from one super portlet with one "execute" method.

This design is called "Smart Servlets". You may find more
on Web or check some java-server books.

Of course sometimes it is not suitable.


James Cook wrote:
> I'm developing a portal application (who isn't?) that is somewhat flexible
> in its design. It is driven by a servlet named Portal that makes calls to
> other classes that are responsible for generating sections of HTML. Most
> frameworks refer to these sections of HTML as Portlets.
> I needed a container that would house these Portlets, and for various
> reasons, I decided to make them servlets as well. There are quite a few
> advantages to this approach:
> 1. Lifecycle of the servlet is managed by the servlet engine. I didn't have
> to develop a container to manage access to them. If I need a portlet to be
> single threaded, I can use the SingleThreadedModel interface, otherwise the
> servlet manages the multithreading.
> 2. The main servlet can invoke them fairly easily using the
> RequestDispatcher mechanism. It's working quite well.
> 3. I can add new portlets or remove others dynamically without affecting the
> Portal servlet.
> 4. Each portlet has access to the user's httpsession for state information.
> I haven't run across any disadvantages...this is where you come in. Am I
> missing anything big here, or are there any circumstances on other servlet
> engines that may affect the design?
> thanks,
> jim
> --------------------------------------------------------------------------
> To unsubscribe, email:
> For additional commmands, email:

Alexander Kogan    Parametric Technology Corporation      128 Technology Drive, Waltham MA 02453

View raw message