Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You’ll seldom come across real-world portlets that don’t need to serve binary content. For instance, the Book Catalog portlet needs to serve the Table of Contents (TOC) of each book in the catalog, which could be in PDF or MS Word format. Similarly, a picture viewer portlet needs to serve images; an announcement portlet needs to provide announcement-related details in PDF or MS Word format.
To download binary content, you can either use a direct link to the resource or a resource URL pointing to the resource. Direct links are created by the portlet and encoded using the encodeURL method of the PortletResponse object. If the resource is located within the portlet application, you can access the resource using a direct link. In previous chapters, you used direct links to add portlet application resources, like CSS and JavaScript files, to the portal page. In the Book Catalog portlet, if the TOCs of all the books are located within the portlet application, direct links can be used to download them.