IBM Portlet API Development

Source: Internet
Author: User
Tags java web websphere application server

This topic provides a brief overview of the IBM portlet API. This API is not recommended, and this topic provides support for portlets that have not yet migrated to the standard Portlet APIs.

Abstract Portlet classes are the core abstraction of the IBM portlet API. The Portlet class extends the httpservlet of the Servlet API. All portlets extend this abstract class indirectly, and inherit from HttpServlet, as follows:

...   +--javax.servlet.http.httpservlet
|
+--org.apache.jetspeed.portlet.portlet
|
+--org.apache.jetspeed.portlet.portletadapter

+--com.mycompany.myapplication.myportlet

Therefore, the portlet is a special type of servlet. The properties of this type of servlet make it easy to insert and run in the Portal server. Unlike the servlet, portlets cannot send redirects or errors directly to the browser, forward requests, or write arbitrary tags to the output stream. The Portlet container relies on the Java EE architecture implemented by WebSphere application Server. As a result, portlets are encapsulated in a way that is similar to the Java WEB application and deployed in a servlet-like manner.

In summary, portlets can be managed more dynamically than the servlet. You can apply the following updates without starting and restarting the Portal server: You can use the portal Site Administration user interface to install and remove portlet applications consisting of several portlets. The settings for a portlet can be changed by an administrator with appropriate access to dynamically create and delete portlets using the administration portlet. For example, once an administrator creates a new cut, the clipping portlet can be used to create a new portlet instance.

The Portlet container relies on the Java EE architecture implemented by WebSphere application Server. As a result, the portlets are encapsulated in the WAR file in a way similar to the Java EE WEB application and deployed in a servlet-like manner. Like other servlet, you use the servlet deployment Descriptor (Web.xml) to define the Portlet to the application server. This file defines the Portlet's class file and read-only initialization parameters.

The following figure shows the portlets after the WAR file was deployed. For each portlet deployed on the portal server, it creates a servlet or Portlet class instance on the application server.

Initialization parameters are set by the Portlet developer and can be read by the portlet using the Portletconfig object. The servlet deployment descriptor can contain multiple Web applications, each of which is defined by the <servlet> element. In addition, each servlet definition can point to the same Portlet class file, so that different initialization parameters can be used for each instance of the Portlet class to create different Portletconfig objects. For more information, see the WEB application Deployment descriptor.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.