Readme for SPFLegacyBlank sample

 

Introduction

The SPFLegacyBlank sample is analogous to the blank sample that is shipped by Jakarta Struts. The purpose of this sample is to show how to package a Struts application using the Struts Portlet Framework. This sample is the suggested starting point for obtaining the files necessary for building a Struts application to be deployed as a portlet. The packaging is similar to what Jakarta Struts ships, with the addition of several jar files, some additional tld files, and some modified tld files. The Jakarta Struts jars are shipped unchanged from the Jakarta Struts blank portlet. The sample can be installed on WebSphere Portal Server and placed on a page, but the user cannot interact with the application. The other samples demonstrate different aspects of creating a Struts application for Portal.

Sample details

The sample is useful to obtain the minimum set of jars and tlds to create a Struts application for portal.

Code Snippets

 

The interesting code snippet is the configuration of the controller. A servlet-based Struts application uses the ActionServlet as the controller. The portlet version instead uses a portlet as the controller. The following snippet shows the servlet class as specified in the web deployment descriptor.

 

    <servlet-class>com.ibm.wps.portlets.struts.WpsStrutsPortlet</servlet-class>

 

The servlet mapping for a Struts action is specified as an init parameter in the portlet.xml.

 

      <init-param>

         <name>struts-servlet-mapping</name>

         <value>*.do</value>

      </init-param>

 

Summary

The SPFLegacyBlank.war file is the starting point for building Struts-based web applications for the legacy container. The jars and tlds from this war file should be used when creating Struts portlet applications for the legacy container.