Struts portlet Release Notes

© Copyright International Business Machines Corporation 2006. All rights reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM® Corp.

Release notes

1.0 Limitations
   1.1 Struts template tags are not well supported by the Struts portlet tools
   1.2 Struts tiles portlet development is not supported by Struts portlet tools
2.0 Known problems and workarounds
   2.1 Imported Struts portlet samples may have target runtime not defined error
   2.2 Dynamic Page Template Support does not work with Struts tiles portlet project

1.0 Limitations

1.1 Struts template tags are not well supported by the Struts portlet tools

When developing a Struts portlet project, be aware that Struts template tags are not well supported by the Struts portlet tool.

  1. When adding Struts templates tag from the palette to the web page, the tool incorrectly generates an Struts web taglib directive for the user:
    <%@taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template"%>
    instead of correct Struts portlet template taglib directive :

    <%@taglib uri="http://struts.apache.org/tags-template" prefix="template"%>

    Fixing the taglib directive for that page does not solve the problem, as subsequent add of the template tags will continue to add the incorrect taglib directive.
  2. Struts template tags are not visualized in the Page designer. 

1.2 Struts tiles portlet development is not supported by Struts portlet tools

The Struts portlet tools currently does not support Struts tiles portlet development, but it does provide Struts tiles portlet samples (IBM and JSR168) that you can import into the workspace to help you configure your portlet to use tiles in a portlet application.

Note: Developing tiles within a Struts portlet project may trigger Dynamic Template Support (Struts Tiles) project facet to be added.  This will cause problems with deployment of your portlet. See known problems and workarounds for more information.

2.0 Known problems and workarounds

2.1 Imported Struts portlet samples may have target runtime not defined error

When you import a Struts portlet sample (IBM or JSR168) into your workspace, imported Struts portlet samples may have a target runtime not defined error. Depending on the workbench configuration and what server has been installed on your machine, you may get an error in your project: "Target runtime WebSphere® Portal V6.0 is not defined". This means that WebSphere Portal V6.0 is not in the workbench's server list.

Workaround:
Before doing anything with the sample, you must set up the target server runtime for your project:

  1. Make sure an appropriate target server is available.
    • You can view and modify the list of available servers by setting your preferences (Windows > PreferencesServer > Installed Runtime).
    • Look for "WebSphere Portal V6.0 stub". This should be installed with the portal tools feature of the product. Otherwise, click the Add button to add a WebSphere Portal V6.0 Runtime.
  2. Select the project imported, and use the context menu to bring up project properties.
  3. Select a targeted runtime. There should be a list of available Targeted Runtimes that match your project.
  4. Click OK
  5. Repeat the steps for the EAR project imported with the sample.

 

After setting the target runtime, re-build the project to remove the errors and then you can deploy it:
  1. To re-build the project, click Project > Clean > Clean all projects or Clean selected projects, then click OK. Note: Some samples contain errors.
  2. To deploy the sample, that contain errors, you must set the preference by selecting the Allow applications containing errors to be published on a server check box ( Windows > Preferences > Server > WebSphere
  3. Click OK.
  4. To deploy your project, select the project (not the EAR project) and click Run As > Run on Server. Make sure the same type of server is selected for your target runtime.


2.2 Dynamic Page Template Support does not work with Struts tiles portlet project

It's possible that while working with Struts tiles portlet, you may trigger the Dynamic Page Template Support (Struts Tiles) project facet to install. Adding Dynamic Page Template Support (Struts Tiles) project facet is an easy way to work with Struts tiles in your dynamic web project, but not with Struts portlet project. If installed, this will cause runtime errors in deployment. Additionally, using the palette to add tiles tags into Struts portlet JSPs will result in incorrect taglib directives being added.

Workarounds: If you are developing Struts tiles portlet, before deployment you should:

  1. Determine if Dynamic Page Template Support (Struts Tiles) project facet has been installed. You can do so by bringing up the Project properties > Project Facet.
  2. If it has been installed, remove additional servlet and config file entries that has been added to your project:
    • Open the web.xml file in the Deployment Descriptor Editor. Then on the Servlet tab, remove the TilesServlet entry and save the file.
    • Open the struts-config.xml file in the Struts Config File Editor. Then on the Plug-ins tab, remove the org.apache.struts.tiles.TilesPlugin entry and save the file.
      Note: Removing Dynamic Page Template Support (Struts Tiles) project facet from Project Facets page does not remove the above mentioned entries. Its better to leave that project facet entry in the list.
  3. For each of the JSP containing tiles tag,  check to see that struts portlet tiles taglib is used.  If not , (this is for WPS V6.0 Struts tiles portlets ),
    • replace: <%@taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
    • with:  <%@taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>