190 WebSphere Portal on z/OS
Figure 6-8 Hello World portlet parameters
After clicking on Finish, Application Developer now builds the project which
takes a few moments during which you will see several messages displayed as it
creates directories, files, compiles Java code, until the project is created. The
project is shown in the portlet perspective as seen in Figure 6-9 on page 191.
Chapter 6. Portlet development and deployment 191
Figure 6-9 The Hello World project
To add the Java code we expanded the source tree in the Navigator panel of the
Hello World project by selecting the “+” next to HelloWorld -> source -> com ->
ibm -> myportlets, as shown in Figure 6-10 on page 192.
192 WebSphere Portal on z/OS
Figure 6-10 Expanded source tree
By double-clicking on HelloWorld.java we obtained the source view of the Java
code that Application Developer had already generated for our project. Since this
was our first Hello World java portlet we deleted all the generated code and
instead copied the code from Example 6-1 on page 185.
We then changed the Java package to the portlet class name we had defined in
“Hello World portlet parameters” on page 190 as shown in Figure 6-11 on
page 193.
Chapter 6. Portlet development and deployment 193
Figure 6-11 Hello World java
Using the keyboard we entered Ctrl+s, which causes Application Developer to
build the project and save it. If there are no errors listed in the tasks frame at the
bottom right of the Application Developer window then the portlet project has
been built successfully and can be tested and deployed.
By right-clicking on the project name in the Navigator frame, and selecting Export
WAR, as shown in Figure 6-12 on page 194, the portlet WAR file can be
exported from Application Developer to a local directory of choice for deployment
on WebSphere Portal for z/OS.

Get WebSphere Portal on z/OS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.