portlet的生命周期扩展了servlet的生命周期,增加了更多的控制。就像servlet的init和destroy的方法一样,portlet使用这些方法初始化和关闭conrete portlet和application portlet。
init():portlet被构造成为一个portlet实例,在容器内被所有用户共享使用,如servlet的共享使用一样。这个方法传递portletconfig实例作为参数。
initconcrete() :portlet构造完成后,portlet被第一次调用之前,初始化portletsettings。
service() :当用户请求portlet时,容器调用此方法为用户提供服务。
destroyconcrete() :此方法用来结束concrete portlet服务,这种情况可能在portal server运行中管理员删除一个具体portlet时发生。
destroy() :当portal server终止运行后,调用此方法表示portlet的生命周期结束。
portlet action 方法:
action处理所有的由portlet触发的事件。任何form或者超连接事件都会导致actionperformed方法执行。其他的事件,如窗口的最大最小化,或者其他portlet传递消息时,也会触发相应的事件。actionevent,windowevent和 messageevent将传递给相应的action。
actionperformed方法当portlet接受到一个action时被调用。这个方法在任何doview、doedit方法执行之前被执行。
void actionperformed(actionevent event)
messagereceived方法当portlet接受到一条消息时被调用。
void messagereceived(messageevent event)
windowmaximized方法当portlet窗口最大化的时候被调用。
void windowmaximized(windowevent event)
windowminimized方法当portlet窗口最小化的时候被调用。
void windowminimized(windowevent event)
windowresized方法当portlet窗口resized的时候被调用。
void windowresized(windowevent event)
portlet render方法
portlet容器将显示页面上所有的portlet,基于他们定义的模式。portlet开发者可以继承这些方法,提供 portletresponse输出流或者使用portletcontext执行include方法包含html文件或者jsp文件。在显示 portlet的时候,dotitle被布局引擎所调用。
doview方法在view模式时被调用
void doview(portletrequest request,portletresponse response)
doedit方法在edit模式时被调用
void doedit(portletrequest request,portletresponse response)
doconfigure方法在configure模式时被调用
void doconfigure(portletrequest request,portletresponse response)
init():portlet被构造成为一个portlet实例,在容器内被所有用户共享使用,如servlet的共享使用一样。这个方法传递portletconfig实例作为参数。
initconcrete() :portlet构造完成后,portlet被第一次调用之前,初始化portletsettings。
service() :当用户请求portlet时,容器调用此方法为用户提供服务。
destroyconcrete() :此方法用来结束concrete portlet服务,这种情况可能在portal server运行中管理员删除一个具体portlet时发生。
destroy() :当portal server终止运行后,调用此方法表示portlet的生命周期结束。
portlet action 方法:
action处理所有的由portlet触发的事件。任何form或者超连接事件都会导致actionperformed方法执行。其他的事件,如窗口的最大最小化,或者其他portlet传递消息时,也会触发相应的事件。actionevent,windowevent和 messageevent将传递给相应的action。
actionperformed方法当portlet接受到一个action时被调用。这个方法在任何doview、doedit方法执行之前被执行。
void actionperformed(actionevent event)
messagereceived方法当portlet接受到一条消息时被调用。
void messagereceived(messageevent event)
windowmaximized方法当portlet窗口最大化的时候被调用。
void windowmaximized(windowevent event)
windowminimized方法当portlet窗口最小化的时候被调用。
void windowminimized(windowevent event)
windowresized方法当portlet窗口resized的时候被调用。
void windowresized(windowevent event)
portlet render方法
portlet容器将显示页面上所有的portlet,基于他们定义的模式。portlet开发者可以继承这些方法,提供 portletresponse输出流或者使用portletcontext执行include方法包含html文件或者jsp文件。在显示 portlet的时候,dotitle被布局引擎所调用。
doview方法在view模式时被调用
void doview(portletrequest request,portletresponse response)
doedit方法在edit模式时被调用
void doedit(portletrequest request,portletresponse response)
doconfigure方法在configure模式时被调用
void doconfigure(portletrequest request,portletresponse response)