Skip to main content

developerWorks  >  WebSphere  >

Tutorial: Creating a JSR 168 portlet for use by diverse portals


Level: Intermediate

Karl Bishop (, Senior Software Engineer, IBM
Ron Lynn (, Senior Software Engineer, IBM

26 Oct 2005

Register now or sign in using your IBM ID and password.

In this two-part tutorial, Ron and Karl playfully guide you along the path of creating a JSR 168-compliant portlet which can be consumed by multiple portals using Web Services for Remote Portlets (WSRP). In part 1, you choose a path for creating the portlet: fork 1, uses the Rational development environment ; fork 2 (for command-line die-hards), uses hand-coding in your favorite editor. You then enable the portlet to access a database using SQL. In part 2 (a future installment), you will make the portlet available to other portals using WSRP. This part will also demonstrate accessing the portlet in a portal running under IBM® WebSphere® Portal V5.1.


  • Create a portlet

  • Access a database from a portlet using SQL

  • Enable the portlet for WSRP

  • Access the portlet from a portal which supports WSRP


You should have these basics skills:

  • Familiarity with Rational® Application Developer
  • Understand portlet development concepts
  • Basic Java™ coding skill

System requirements

You need the following software installed to work through the scenario in this tutorial.

  • IBM Rational Application Developer for WebSpherer V6, or Rational Software Architect V6
  • IBM WebSphere Portal V5.1.x
  • IBM WebSphere Application Server 5.1.x
See Product trial downloads for currently available trial software.


2 hours


html, pdf


Rational Application Developer and Rational Software Architect both provides wizards for creating JSR168-compliant portlet skeletons. You can fill in the generated portlet skeleton with Java code to perform a specific task. However, some programmers want to know the nitty-gritty; that is, they want to know how you create a JSR 168 portlet if you don't have an IDE. Said another way, they want to know what that IDE is doing, anyway. So, part 1 of this tutorial gives you options. You can either use the tool, or you can hand-code. Either way, you create a portlet which conforms to the JSR 168 specification.

Now, the beauty of writing to standards is that you maximize the possibility of making the portlet available for different portals, which could run under different portal servers. Enter WSRP. By deploying your JSR 168 portlet so that it is consumable as a remote portlet which adheres to WSRP, you make your portlet available to a variety of portals. Part 2 of this tutorial shows you how to do just that. It also demonstrates how to access the portlet you created in part 1, from a portal which runs under WebSphere Portal V5.1 , which just happens to support WSRP.

Share this....

digg Digg this story Slashdot Slashdot it!

Back to top

Document options

Document options requiring JavaScript are not displayed

My developerWorks needs you!

Connect to your technical community