By admin /

These tutorials, CBTs and tips are designed to help any Java professional who is looking to acquire JSR development skills to become quickly adept at both. In this three-part series, the articles describe new features available in the Java Portlet Specification (JSR ) and extensions supported by OpenPortal. Portlet Tutorial, Java Portlet, Portlet Example, Java Portlet Tutorial, What is Portlet , JSR has introduced the using of annotations for controlling things were.

Author: JoJoshakar Tujind
Country: Eritrea
Language: English (Spanish)
Genre: Travel
Published (Last): 5 March 2014
Pages: 378
PDF File Size: 15.50 Mb
ePub File Size: 13.38 Mb
ISBN: 779-8-40140-297-8
Downloads: 65114
Price: Free* [*Free Regsitration Required]
Uploader: Mikakora

Creating a simple portlet

To facilitate deployment of portlet applications and complex portlets, you can provide a portlet configuration file that can be invoked by the XML configuration interface XMLAccess. Use this file if you use services from the Public SPI javadoc package. The following shows the minimum elements required for the standard portlet deployment descriptor.

View the basic steps for creating a simple portlet, that include writing the portlet code, compiling java source, creating the JAR file, writing the portlet descriptors, setting up the WAR file directory structure, and packaging and deploying portlets. For example, a portlet application might use a portlet descriptor as follows: Therefore, the portal server copies jsd.

The WAR file format contains the Java classes and resources that tutoral up one or more tutoriial in a portlet application.

This is especially useful for portlets that use messaging because these portlets have to be placed on the same page. Next, the portlet must be packaged in the JAR file format. If you are familiar tutorail the web. The Hello World portlet provides an introduction to writing your first portlet.

There are number of differences between the elements in this example and the corresponding Figure 8.

You can also run the build-war-file or build-ear-file tasks to build the. After installation, the portlet is ready for use and does not require the server to be restarted. Runtime classpath RP branches from runtime classpath patches. Runtime extensions RE branches from runtime classpath, and application extensions AEX branch from runtime extensions.


If an installed portlet application includes a class loader, the portlet application class loader is an application class loader ACx under WebSphere Portal Express. Rational Application Developer provides wizards to help you build, test, and deploy portlets using all of the APIs and related classes and interfaces available in the portlet run time environment. The graphic illustrates where WebSphere Portal Express and portlet applications fit into the classloading hierarchy.

If this value has not been specified, specify the WAR file name of the portlet application in its place. Standard portlets Table 2. The portlet information directory is not part of the public document tree of the application.

You can set up the run time environment for debugging portlets on the local development machine or on a remote server. The application server searches for security policy files in the location of the enterprise application archive rather than the Web application archive.

Creating a simple portlet

The portlet is provided along with the source in the IBM Portlet Samples package, which sjr available from the portlet catalog by searching for navcode 1WPZ. Use this file if you use services from the Public API javadoc package. Compile your Java source files.

Portlets contained in WAR files have the advantage of being dynamically downloaded and installed.

WebSphere Portal Express includes an administrative portlet for installing, uninstalling, and updating portlets. When constructing XMLAccess scripts for use in installing standard portlets, use the following values: The portal administrator can download a WAR file from the Internet and then use the portal administration interface to install the portlet to WebSphere Portal Express.

Refer to the documentation for Rational Application Developer for complete setup instructions. The XML configuration interface allows the portlet developer to specify places, pages, themes, skins, supported markups and clients, and other settings for a portlet application.

A particular class loader can reference other classes as long as the other classes can be loaded by the same class loader or any of its ancestors, but not its children.


The resources can be images, JSP files, Writing the portlet descriptorsand property files containing translated message text. On a portal server running on Windows, installing a WAR file with a name that is more than 25 characters will result in an error.

To deploy a portlet and run it on the server, it must be packaged in the form of a Web application ARchive or WAR file. That is, the WAR file name can be changed, but the uid must indicate the original uid used during portlet installation. You can also build portlets using your own development environment and tools.

If you are not using wizards to develop portlets, the following topics describe the mechanics of building a simple portlet. Before you package your portlet, the class files and resources must be arranged in the WAR file directory structure described here. GenericPortlet which also can throw a PortletException. See Sample portlets for more information.

In the following graphic runtime classpath patches RCP is located at tutorisl top of the hierarchy. Because Windows limits the maximum path length to characters, the name of the WAR file must be less than 25 characters.

Hello World provides the fewest methods required for a portlet. Then, compile the portlet using the fully qualified path to the Java portlet source. A portlet application exists as a structured hierarchy of directories.

Before you begin developing portlets, set up an environment that makes the tasks of writing, compiling, and testing portlets easier. For portlet updates, the WAR file name must be the original name of the WAR file used to install the portlet application. To do tjtorial, proceed as follows: It uses the portlet response object to write simple output directly to the portal page.