Differences between revisions 3 and 4
Revision 3 as of 2006-09-19 23:25:37
Size: 842
Comment:
Revision 4 as of 2009-09-20 22:06:15
Size: 846
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
Source file: attachment:TemplateNameFilter.java Source file: [[attachment:TemplateNameFilter.java]]

This filter is useful if you want to be able to progressively transform a static site into a dynamic site. Typically, it happens when a designer gives to the coder a static model of a site where the links between pages are functionnal but the data shown inside are frozen.

Storing the regular files and the templates in different directory trees is feasable but really painful for the coder.

Thus, we need to store the templates and the regular files in the same directory tree, distinguishing templates with a supplementary ".vtl" extension, but without breaking former URLs.

The purpose of this filter is to allow this naming convention (foo.html and bar.html.vtl) while hiding .vtl from URLs (/foo.html and /bar.html): it will add ".vtl" when the target resource is a template.

Source file: TemplateNameFilter.java

TemplateNameFilter (last edited 2009-09-20 22:06:15 by localhost)