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.
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
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.