`
pwosboy
  • 浏览: 84261 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

Portlet Life Circle

阅读更多
Portlet life circle diagram
init(PortletConfig config)
 
This method is called by the portlet container on the abstract portlet when the portlet is first loaded. As with servlets, portlets are loaded when they are first requested. Any subsequent calls to the portlet will not execute this method. Generally, initialization that is applicable to every concrete portlet based on this abstract portlet is placed in this method. If you choose to override this method, at a minimum it should make a call to its parent via super.init(portletConfig). At this point in the portlet life cycle, no portlet-specific storage objects are available. This includes PortletSession, PortletData, PortletApplicationSettings and PortletSettings.
initConcrete(PortletSettings settings)
 
This method is called by the portlet container on the concrete portlet. The initialization code performed in this method is not shared by other concrete portlets even though they may be based upon the same abstract portlet. It is in this method that the PortletSettings object is first available. The PortletSettings encapsulates the concrete portlet configuration parameter information. From the PortletSettings object, the PortletApplicationSettings object is available. The PortletApplicationSettings object encapsulates concrete portlet application context parameters. In this method, no user-specific objects are yet available.
 
login(PortletRequest request)
 
If the concrete portlet has been placed on a page that requires authorization, the login method is called by the portlet container to associate a user with the portlet. It is at this point that the PortletData object is first available. The PortletSession is created by the container for the registered user at this point and is available in this method via the request object. If the request for the portlet is made by an anonymous user, this method is not called. If this method is not called, a default session object can still be created with no user association, though it may be of little practical use. This method is actually defined in the PortletSessionListener interface which is implemented by the abstract class Portlet. Since your custom portlets will extend from Portlet, it is included in this discussion even though other oft-used listeners are not..
 
service(PortletRequest request, PortletResponse response)
 
This method is called on each and every request of the portlet. After the portlet has been added to a page and initially accessed by a user, this is the only method that will be called by the portlet container on subsequent requests. Generally, this method will delegate the request to the appropriate do method to render content. At this point, all portlets and, if applicable, user-specific objects are available.
 
logout(PortletSession session)
 
Only when a user specifically selects the Log Off button on the portal is this method called. This method provides you with the opportunity to manage any user-specific information once the user has logged out and to clean up user-related resources. If the user removes the portlet from their page, the logout method is not called until the user actually logs out of the portal, even though they no longer are accessing the portlet. When the portlet is taken out of service by the Portal server or the administrator, this method will not be called. The PortletSettings object is still available in this method, although the PortletRequest is not. This method is actually defined in the PortletSessionListener interface which is implemented by the abstract class Portlet. Since your custom portlets 82 IBM WebSphere Portal Toolkit V5 will extend from Portlet, it is included in this discussion even though other oft-used listeners are not.e.
 
destroyConcrete(PortletSettings settings)
 
This method is called when the concrete portlet is taken out of service either because of the portal server stopping or the application being uninstalled from the portal server. The portlet container will call each running concrete portlet in the application individually when the application is deleted. In this method, the PortletSettings object is passed in as a parameter and cannot be retrieved from the normal getPortletSettings method.DIV>
 
destroy(PortletConfig config)
 
The portlet container executes this method on the abstract portlet when the portlet is taken out of service. Since it is executed on the abstract portlet and not the concrete portlets, it is executed only once. This method provides an opportunity to execute clean-up code on each and every concrete portlet in the application derived from this abstract portlet.
 

分享到:
评论

相关推荐

    portlet源码,portlet Filter

    Portlet是一种在Web应用程序中,特别是企业级门户平台中,用于呈现内容和功能的可重用组件。在Java世界中,portlet技术主要基于JSR 286(Portlet 2.0 API)标准,它定义了portlet如何与门户服务器交互。本篇文章将...

    Portlet标准汉化手册

    【Portlet标准汉化手册】深入解析 在现代企业级Web开发中,Portal Server成为了构建复杂网站架构的重要基础。本文将详细介绍Portlet标准及其在Portal中的应用,帮助读者理解这一技术的核心概念。 **1. 什么是...

    portlet入门介绍

    Portlet入门介绍 在Web开发领域,Portlet是一种特殊的组件,它被设计用来构建可复用、可配置的Web应用程序,通常在Portal环境下运行。Portlet技术为用户提供了一种集中访问多种服务和信息的方式,例如新闻、天气...

    portlet开发参考手册

    Portlet开发参考手册是针对portlet技术的一份详细指南,它为开发者提供了全面的指导,以帮助他们构建和集成portlet到Web门户中。Portlet是一种可重用的Web组件,它们在门户环境中运行,允许用户自定义门户界面,展示...

    jquery portlet

    **jQuery Portlet 知识详解** `jQuery Portlet` 是基于 jQuery UI 框架实现的一种portlet组件,它主要用于构建可自定义布局、具有拖放功能的Web应用程序界面。Portlet是Web应用中的一个模块化组件,常用于企业级...

    Portlet规范介绍.rar

    Portlet是一种Web应用程序组件,主要用于构建企业级的门户系统。Portlet规范定义了这些组件如何在门户环境中交互、渲染和管理用户界面。本篇文章将深入探讨Portlet的概念、功能、工作原理以及相关的技术标准。 ...

    Spring mvc portlet demo

    **Spring MVC Portlet Demo** Spring MVC Portlet是一个用于构建portlet应用程序的框架,它结合了Spring MVC的灵活性和portlet规范的强大功能。在这个demo中,我们将会深入探讨如何利用Spring 3.0 MVC架构来开发...

    IBM portlet api 和 中文教程

    IBM Portlet API是WebSphere Portal应用开发中的核心组件,它为构建portlet提供了一套标准的接口和类库。Portlet是一种可重用的Web组件,它们可以集成到门户环境中,展示来自不同数据源的信息,并与用户进行交互。...

    Stringbeans3.5 加载外部portlet应用

    在IT行业中,Portlet是一种可重用的Web组件,它可以在门户环境中运行,提供特定的功能或服务。Stringbeans是一个流行的portlet容器,它允许开发者构建和管理portlet应用。本篇文章将详细探讨如何在Stringbeans 3.5...

    portlet 开发

    Portlet开发是构建企业级Web应用程序的一种方法,特别是在Java平台上,它被广泛应用于构建可重用、可组合的Web组件。Portlet技术允许开发者创建独立的功能模块,这些模块可以集成到更大的Web门户中,为用户提供个性...

    Portlet

    1. **portlet容器**:portlet容器是运行portlet的平台,它负责管理portlet生命周期,包括初始化、渲染、事件处理等,并提供portlet间通信的机制。常见的portlet容器有IBM WebSphere Portal、Liferay Portal和JBoss ...

    portlet详细例子

    3. **Portlet配置**:portlet可以通过portlet.xml文件进行配置,定义portlet的元数据,如portlet名称、标题、描述、支持的portlet模式等。 4. **portlet上下文**:提供portlet访问其环境信息,如请求、响应对象、...

    Liferay portlet 工程示例代码

    Liferay Portlet工程示例代码提供了开发者们一个深入理解并实践Liferay Portal平台上的portlet开发的宝贵资源。Liferay Portal是一款开源的企业级门户系统,它允许用户创建、管理和集成各种Web应用程序,而portlet...

    portlet-api.jar

    portlet-api.jar portlet-api.jar portlet-api.jar

    portlet api

    Portlet API 是一个重要的软件开发接口,主要用于构建和管理企业级Web应用程序,特别是门户(portal)环境中的可重用组件。IBM API 和 JSR168 API 都是Portlet API 的实现或扩展,它们为开发者提供了在门户环境中创建...

    portlet学习资料

    Portlet技术是构建企业级Web应用的重要组成部分,特别是在门户(portal)环境中,它允许开发者创建可重用、可组合的Web组件。JSR168(Java Portlet Specification 1.0)是Java社区进程发布的一项标准,为portlet的...

    使用spring mvc portlet 3.0开发IBM WebSphere Portlet应用

    在本文中,我们将深入探讨如何使用Spring MVC Portlet 3.0框架开发针对IBM WebSphere Portal的应用。Spring MVC Portlet是Spring Framework的一部分,它提供了一种优雅的方式来构建portlet应用程序,而IBM WebSphere...

    PortLet 入门小例子

    Portlet是一种可重用的Web组件,主要用于企业级应用程序,特别是内容管理系统如IBM WebSphere Portal或Liferay Portal中。Portlet允许开发者创建交互式的、个性化的内容小部件,这些小部件可以嵌入到门户页面上,为...

    portlet资料

    【portlet资料】主要涵盖的是关于portlet开发的相关知识,这一领域主要在企业级应用,特别是Java企业版(Java EE)环境中广泛使用。Portlet是一种可重用的Web组件,它能够集成到portlet容器(如门户服务器)中,为...

Global site tag (gtag.js) - Google Analytics