What is portlet

In this article we will see what is portlet, what is Java Portlet and its characteristics.


Portlet in General

  • Portlet is a web component. Combine with other portlets, they form a complete comprehensive web page.
  • In simple term, we can say that a portlet is an independent web application. Which is used to render some portion of complete web page.
  • Just like other web applications, it takes request (HTTP or HTTPS) and generates response.
  • Content rendered by Portlet is just part of whole page.
  • Many portlets together form a complete web page. This way multiple functionality are available on one page. Thus how a Portal is developed.

Java Portlet

  • Following two Java Specification Request (JSR) defined for Java Portlet.
    • JSR-168 ( or Portlet 1.0 Specification )
      • This specification was defined to show aggregate content of multiple component on page.
    • JSR-286 ( or Portlet 2.0 Specification )
      • This specification was added on top of JSR-168 with additional features.
      • Key features to this specification are as below
        • Inter Portlet Communication (IPC)
        • Ajax support
        • Serving resource like images, pdf etc.
        • Allow changing header like cookies, meta tags etc
        • Annotation support 
        • Improved web framework integration
        • Portlet managed modes
      • Its super set of JSR-168.
  • These specification describes life cycle and characteristics of portlets.
  • To know more about the Portlet specification, refer following links

Advantage of using Java Portlet

  • Portability :- 
    • Just like Servlet, Java Portlet written based on these specification can be deployed and executed on any compatible Portlet container. Thus Java Portlets are portable across portal containers.
  • Maintenance :- 
    • The underlying Java Portlet API and architecture will not change across the compatible portlet container.
  • Easy to Learn :-
    • Java Portal API is available as a part of JSR Docs, and it will be consistent across portal container. 
I would recommend looking at index page ‘A Complete Liferay Guide‘ to browse all topics about liferay.

Recommended For You

About the Author: Nilang

Nilang Patel is a technology evangelist who loves to spread knowledge and helping people in all possible ways. He is an author of two technical books - Java 9 Dependency and Spring 5.0 Projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.