The blank sample is analogous to the blank that is shipped by Apache Struts. The purpose of this sample is a means to ship the JARs and TLD files that are necessary to build a Struts application using the Struts Portlet Framework. This sample is the suggested starting point for obtaining the files necessary for build the Struts application to be deployed as a portlet. The packaging is similar to what Apache Struts ships with the addition of several jar files, some additional TLD files, and some modified TLD files. The Apache Struts JARs are shipped unchanged from the Apache Struts blank. This sample is not very interesting other than the packaging. The sample can be installed on the portal server and placed on a page, but the user can not interact with the application. The other samples demonstrate different aspects of creating a Struts application for portal.
The sample is useful to obtain the minimum set of JARs and TLDs to create a Struts application for portal. The application itself is not very interesting.
The interesting code snippet is the configuration of the controller. The servlet based Struts uses the ActionServlet as the controller. The portlet version of the Struts Portlet Framework instead uses a portlet as the controller. The following snippet shows the portlet class as specified in the portlet deployment descriptor.
<portlet-class>com.ibm.portal.struts.portlet.StrutsPortlet</portlet-class>
The servlet mapping for a Struts action is also specified in the portlet.xml. The following init parameter shows how to specify the servlet mapping to identify Struts actions.
<init-param> <name>struts-servlet-mapping</name> <value>*.do</value> </init-param>
The SPFStandardBlank.war file is the starting point for building web applications using Struts for the standard container. The JARs and TLDs from this WAR file should be used when creating Struts applications for the standard container.