Chapter 3. Portlet 2.0 API—portlet objects and container-runtime options

 

This chapter covers

  • Using the portlet container’s request and response objects
  • Adding external JavaScript and CSS files to a portal page
  • Accessing a logged-in user’s information via user attributes
  • Understanding PortletContext, PortletConfig, and PortletSession
  • Using container-runtime options

In the context of the example User Registration portlet, chapter 2 introduced you to some of the classes and interfaces of the Portlet 2.0 specification. This chapter and the next will provide comprehensive coverage of the Portlet 2.0 API using an example Book Catalog portlet.

In this chapter, we’ll look at portlet objects, methods, and features that you’ll come across often while developing portlets. Chapter 4 will cover advanced portlet features that let you cache portlet content, localize portlet content, define custom portlet modes and window states, and secure portlets from unauthorized access.

Note

We’ll cover classes and interfaces specific to serving resources, inter-portlet communication, portlet filters, and personalization in chapters dedicated to these topics.

3.1. Requirements for the Book Catalog portlet

3.2. Portlet request objects

3.3. Portlet response objects

3.4. Storing user-specific data in a portlet session

3.5. Discovering the portlet environment using PortletContext

3.6. Retrieving portlet configuration using PortletConfig

3.7. Container-runtime options

3.8. Summary