且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

portlet和servlet之间有什么区别?

更新时间:2023-12-04 10:48:28

Portlet是其中的一部分JSR-168标准,用于管理门户容器和组件。这是与Web容器(和servlet)标准不同的标准。虽然这两个标准之间肯定有很强的相似之处,但它们在容器,API,生命周期,配置,部署等方面存在差异。

Portlets are part of JSR-168 standard that regulates portal containers and components. This is different standard from standards for web containers (and servlets). Though there are definitely strong parallels between these two standards they differ in containers, APIs, life cycle, configuration, deployment, etc.

portlet与servlet之间的主要区别可能是因为servlet总是响应单一类型的操作 - 请求,portlet(由于其生命周期的性质和更强的容器绑定)必须响应两种类型的操作: render 请求。当然还有更多内容,但我在研究门户开发时发现这是两者之间的核心差异。

The main difference between portlet vs. servlet could be that while servlet always responds to single type of action - request, portlet (due to nature of its life cycle and stronger container bindings) has to respond to two types of actions: render and request. There are of course more to it but I found this as the core difference between the two when I studied portal development.