Developing a Java Portlet issimilar to the process of developing a Servlet based web applications. The
main differences are:
• The portlet only produces afragment of the final HTML and not the full markup. The portal will join
the fragments of several portletsand will create the full page returned to the user.
• The class receiving therequests has to inherit from javax.portlet.Portlet instead of
javax.servlet.http.HttpServlet.
• A portlet request may involve atwo phase process:
1. On each request at most oneportlet will be able to perform an state-changing operation. This is
referred to as the Action phaseand is implemented through a method called processAction.
Not always an action phase isneeded. Requests that involved an action phase are invoked to an
URL known as an ActionURL, whilethose that only have a render phase are invoked through a
RenderURL.
2. Next is the render phase whereall other portlets related to the page that is going to be returned may
be called in any order to producethe HTML fragment to draw themselves. Portlet implement this
functionality through a methodcalled render.
• Existing web applicationdevelopment frameworks such as Struts, JSF, Webworks, etc can be used
through the use of Bridges. Otherexisting frameworks have been adapted to be usable directly
without the need of a bridge. Anexample is the Spring Portlet MVC framework.
A portlet container is a serverside software component that is capable of running portlets. A portal is a
web application that includes aportlet container and may offer additional services to the user. Liferay
Portal includes its own portletcontainer and offers lots of functionalities such as user and organization
administration, creation ofvirtual communities, having pages based on portlet layouts, graphical
selection of portlets anddrag&drop to place them, grouping pages into websites, several bundled
ready-to-use portlets, and much more.
0 comments:
Post a Comment