concept portlet - specific object in category java

appears as: portlet-specific objects
Portlets in Action

This is an excerpt from Manning's book Portlets in Action.

The portlet tag library is a set of tags that provide included and forwarded JSPs with access to portlet-specific objects (such as RenderRequest, RenderResponse, and PortletSession) and it also makes it simpler for JSPs to create portlet URLs. In this chapter, we’ll discuss the portlet tag library tags, their attributes, and their usage in developing portlets. You’ll rebuild the Book Catalog portlet so that it uses portlet tag library tags.

You saw in chapter 3 that if you add an attribute to RenderRequest, it’s mirrored by HttpServletRequest and vice versa, and the same applies to HttpSession and PortletSession. So what difference does it makes if you use portlet-specific objects in JSPs? There are subtle but important differences between the servlet and portlet APIs. For instance, in your JSP page, you can’t use HttpServletResponse to create a portlet URL; only the RenderResponse object provides methods to create portlet URLs. Similarly, HttpServletRequest can’t provide information about the portlet mode and window state; the PortletRequest provides methods to obtain window state and portlet mode. The objects look similar, but they offer slightly different functionality.