Tiles insert error: Illegal to flush within a custom tag

Published: Saturday, 16 April 2005
Last modified: Monday, 24 October 2005

Illegal to flush within a custom tag

I ran into this problem today when combining jstl and tiles tag. When inserting a tile using the tiles:insert tag, sometimes an illegal to flush error would appear.

jsp error: Can't insert page '/tiles/example_tile.jsp' : Illegal to flush within a custom tag

To get past this error, add a flush="false" attribute to the tiles:insert tag

<tiles:insert name="example.tiles.page" flush="false"/>

However, this may impact performance on high traffic websites.