Portlet规范中是这样定义portal的:
A portal is a web based application that –commonly- provides personalization, authentication,, content aggregation from different sources and hosts the presentation layer of Information Systems.
A portal is a web based application that –commonly- provides personalization, authentication,, content aggregation from different sources and hosts the presentation layer of Information Systems. |
Portal是一个基于web的提供个性化、登录授权、从不同的数据源聚集内容基于展现层的信息系统。具体到J2EE领域,portal大多数情况是一个符合J2EE标准的ear包工程。
什么是portlet
规范中式这样定义portlet的:
A portlet is an application that provides a specific piece of content (information or service) to be included as part of a portal page. It is managed by a portlet container, that processes requests and generates dynamic content
A portlet is an application that provides a specific piece of content (information or service) to be included as part of a portal page. It is managed by a portlet container, that processes requests and generates dynamic content |
一个Portlet是一个基于java技术的被portlet容器管理的web组建,它可以处理requests、生成动态的内容输出,一个portlet负责提供portal 页面中的某个特定部位的展现内容。
与servlet同样,portlet的生命周期是被portlet容器来管理的。Portlet生成的内容也可以称作fragment,这些多个portlet生成的多个fragment会被portal聚集(aggregate)在一起展现。不同用户看到的portlet可能不同,这依赖于不同用户对使用portlet的配置。
什么是portlet容器
规范中式这样定义portlet容器的
A portlet container runs portlets and provides them with the required runtime environment. A portlet container contains portlets and manages their lifecycle. It also provides persistent storage for portlet preferences. A portlet container receives requests from the portal to execute requests on the portlets hosted by it.
A portlet container runs portlets and provides them with the required runtime environment. A portlet container contains portlets and manages their lifecycle. It also provides persistent storage for portlet preferences. A portlet container receives requests from the portal to execute requests on the portlets hosted by it. |
Portlet容器提供portlet生命周期环境,管理portlet的生命周期,还提供portlet preferences的持久化支持,portlet从portal接受请求,然后分发给运行其上的portlet。
Portlet不负责聚集portlet生成的内容,这是portal责任。根据中间件厂商的实现方式portlet容器与portal可以放在一个application中实现,也可以放在两个不同的application中实现。
三者关系
下面是以一个用户使用web客户端来与portal交互的用力,描述portlet、portlet容器、portal三者关系、责任:
1.web客户端通过http 来对portal发起request请求
2.request请求被portal就收到
3.portal分析这个请求是否需要与portlet进行交互
4.如果需要,则portal通知portlet容器调用portlet处理交互
5.Portal通过portlet容器得到portlet返回的fragments
6.Portal聚集portlet产生的fragments,生成最终的页面,返回给web客户端