July 06, 2006

Tiles Sans Struts?

The Dilemna: Finding a Tiles example that works with Struts 1.2.9

From the documents on the web you would think it was easy to create a Tiles interface independently of Struts. However the links are dead in the current version. Also, I believe some of the documentation is dated, and the scattered remains you find today on the web are leftover descriptions from an older version of Tiles. I have created a fixed example that fits with some of the previous documentation, but actually will work in the case of using Tiles definitions.

Tiles Background

Issues

  1. The Tiles installation document states that in order to use Tile independently, you would use the TilesServlet, located in the struts-tiles-VERSION.jar. There is not a TilesServlet, nor a struts-tiles-VERSION.jar, in the struts-1.2.9-src, -lib, or -bin deliveries. The Tiles installation document has a dead link to http://struts.apache.org/1.x/struts-tiles/cvs-usage.html.
  2. The Tiles FAQ page has a dead link to http://cvs.apache.org/builds/jakarta-struts/nightly/sandbox/tiles-core/.
  3. The example in the API from 1.x Struts has some extra escaping of > characters.
  4. The Examples from 1.x Struts page is incomplete.
  5. The Definition tag does not mention name. Name is a required attribute for definition.

Solution

  1. To use the Tiles in the current version of Struts, you will need to use the Struts servlet. I have uploaded a working example with all of the necessary components at: http://www.guesttime.com/members/ledlogic/struts/TilesTest-0.1-src.jar If you build this and deploy the war to a webserver, there are 3 examples in the line of the original struts examples, one for pure JSP (/jsp/jspExample.jsp), one with JSP + tiles (/jsp/tilesExample.jsp), and the last is (/jsp/tilesXMLExample.jsp).
  2. I am not sure if there are nightly builds somewhere for tiles.
  3. The javadoc needs to be fixed in the java source for the tiles package.
  4. Perhaps some of the information here could be incorporated. Do you need someone to finish the documentation for Tiles? If so I can help.
  5. See the above example source package for an example. I used name, not id.
    	
    		
    		
    		
    	
    
Posted by ledlogic at July 6, 2006 01:27 AM