The blank sample is analogous to the blank that is shipped by Jakarta 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 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. 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.