Monday, December 28, 2009

Liferay: include JSP into Velocity templates

I am working on a Liferay's theme. Hooray, no more moronic pain in ass because of Velocity templates. Velocity templates now are mainstream when you're building a Liferay's theme and zero (yes, zero) documentation of how to use other template system. JSP that just works great, is easy to use, well integrated in your favorite IDE with all the documentation and autocomplete stuff, and you already know them well. So let's Liferay developers eat their Velocity, while we go tradition stuff.

Anyway, to add some JSP page into your theme, simply do like this:

$theme.include($themeServletContext, "/elements.jsp")

This example assumes that you have a file, called "elements.jsp" and it is located in the root of your theme (i.e. accessible from the URL like "http://yourhost/your-theme-name/elements.jsp").


Kirill said...

Thanks a lot

you saved my day!!!!

sprilus said...

you have saved my sundayy!!!!
thanks !!!!