Chapter 1. My first pervasive portlet application 11
Figure 1-10 Miscellaneous window
11.You may receive a dialog box prompting you to switch to the Portlet
Perspective to work on this project. Click Yes and optionally check Do not
show this message again to continue.
Figure 1-11 Perspective switch
1.3 Examine the relevant files and source code
Now that the framework for the project has been made, we will examine how this
portlet works. Follow these instructions:
1. To begin, we will examine the files that are used to configure this portlet so
that it can run on a portal server: portlet.xml and web.xml. These files are
located in the Project Navigator panel in the upper left corner of the window.
Double-click the portlet.xml file. This is the portlet deployment descriptor. It
contains important information regarding what markups and modes the
portlet supports.
12 IBM WebSphere Everyplace Access V5, Volume II: Application Development
Figure 1-12 Portlet.xml in the File Navigator panel
The portlet deployment descriptor editor displays the portlet.xml values.
Chapter 1. My first pervasive portlet application 13
Figure 1-13 Portlet deployment descriptor editor
By selecting helloworld.HelloWorldPortlet under the Portlet Application, you
can view the options related to this portlet such as supported markup
languages and modes. If you were adapting an existing portlet to multiple
languages and devices, this is where you would add that support.
14 IBM WebSphere Everyplace Access V5, Volume II: Application Development
Figure 1-14 Portlet deployment descriptor editor
By selecting the source button in the bottom left corner of the portlet.xml
editor, you can view the source of the portlet.xml file.
Example 1-1 Portlet.xml source
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE portlet-app-def PUBLIC "-//IBM//DTD Portlet Application 1.1//EN"
"portlet_1.1.dtd">
<portlet-app-def>
<portlet-app uid="helloworld.HelloWorldPortlet.b045da33e6"
major-version="1" minor-version="0">
<portlet-app-name>HelloWorld application</portlet-app-name>
<portlet id="helloworld.HelloWorldPortlet"
href="WEB-INF/web.xml#helloworld.HelloWorldPortlet" major-version="1"
minor-version="0">
<portlet-name>HelloWorld portlet</portlet-name>
<cache>
<expires>0</expires>
<shared>no</shared>
</cache>
<allows>
<maximized/>
<minimized/>
Chapter 1. My first pervasive portlet application 15
</allows>
<supports>
<markup name="pda">
<view />
</markup>
<markup name="html">
<view />
</markup>
<markup name="wml">
<view />
</markup>
</supports>
</portlet>
</portlet-app>
<concrete-portlet-app uid="helloworld.HelloWorldPortlet.b045da33e6.1">
<portlet-app-name>HelloWorld application</portlet-app-name>
<concrete-portlet href="#helloworld.HelloWorldPortlet">
<portlet-name>HelloWorld portlet</portlet-name>
<default-locale>en</default-locale>
<language locale="en">
<title>HelloWorld portlet</title>
<title-short></title-short>
<description></description>
<keywords></keywords>
</language>
<config-param>
<param-name>pda-icon</param-name>
<param-value>/images/pda/default.gif</param-value>
</config-param>
</concrete-portlet>
</concrete-portlet-app>
</portlet-app-def>
2. Now double-click the web.xml file in the Project Navigator panel. This is the
Web deployment descriptor. It stores parameters related to how the portlet
will run on an application server.

Get IBM WebSphere Everyplace Access V5 Handbook for Developers and Administrators Volume II: Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.