https://www.ibm.com/developerworks/cn/java/j-lo-jsr286-1/
http://www.ibm.com/developerworks/cn/java/j-lo-jsr286-2/
http://www.ibm.com/developerworks/cn/java/j-lo-jsr286-3/index.html
http://www.oracle.com/technetwork/java/jsr286-141866.html
http://www.theserverside.com/tutorial/JSR-286-development-tutorial-An-introduction-to-portlet-programming
Portlet Specification (JSR 286)
web based components, rendered (fragment) within the confines of a portlet page
enable integration between applications and portals
portlet in two flavours:
provide small amount of functionality and then aggregated by portal server into larger application, or
whole application be written to reside in only one or a few portlet windows
implements javax.portlet.Portlet interface
in WAR, once loaded will not unload until server shutdown / explicitly take down
life cycle methods:
init
destroy
processAction - to be used during action-processing phase
render
abstract class GenericPortlet - usually not implement interface but extend
doDispatch - dispatches incoming requests to the appropriate method
doView
PortletRequest / PortletResponse
doEdit
doHelp
in WAR
web.xml: <web-app> <display-name>... <welcome-file-list>...
WEB-INF/portlet.xml
name
display-name
portlet-class
supports
mime-type (text/html)
portlet-mode
portlet-info
title
default-namespace: http://portletbook/
a single portlet application maps to one WAR and may have multiple portlets
Events
a life cycle operation, occurred before rendering
loosely coupled, brokered means of communication between portlets
portlet application defines event name in event-definition element
portlet declare events in deployment descriptor (event-definition), must be first defined in portlet application
to publish : supported-publishing-event
to process : supported-processing-event
QName (getQName()) - id uniquely
getName() - only local part of event name
wildcards and aliases available
Public Render Parameters
public render parameters set in processAction() are available in render parameters of other portlets
simpler to use than events
portlet declare public render parameters in public-render-parameter element in portlet application section
portlet specify public render parameters to be shared in portlet section through supported-public-render-parameter, referencing the id of a public render parameter defined in portlet application section
Direct link to resource
good for static resource that is same to all portlets
Resource service