Beruflich Dokumente
Kultur Dokumente
Portlet JSPs cannot link directly to content (for example, images, applets, other JSPs, or other
resources) within the portlet's WAR directory structure. Instead, they have to use the services of the
portlet container to create portlet URLs from which the content can be accessed. Use the encodeURL()
method of the PortletResponse to access content within the portlet WAR structure. The following
examples are used in the View World portlet samples.
<img src='<%=renderResponse.encodeURL(renderRequest.getContextPath() +
"/images/earth.jpg")%>'
alt="Earth" />
Create a second file cachespec.xml and keep it in the WEB-INF directory to turn on caching.
<cache>
<cache-entry>
<class>portlet</class>
<name>StdWorldClock</name>
<property name="consume-subfragments">true</property>
<cache-id/>
</cache-entry></cache>
Enable Portlet Fragment Cache in the Application server after logging in to the admin console.
Use the Portal configuration client to update global WebSphere Portal settings, such as portlet services
settings that are found in the PortletServices.properties file. This also allows you to
change the portlet services implementation. In a well-defined portlet service, a developer can change
the portlet service implementation without changing the portlet service interface. The portlet view layer
is independent of any changes to the underlying model layer.
Another advantage of using XML Access scripts is that in a production environment with several portal
servers instances for development, staging, quality assurance, and production, the portal administrator
can maintain one set of scripts for each installation. The administrator can also make any server
dependent changes in the deploy scripts without having to change the base code.