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").

Tuesday, December 08, 2009

JNLP and Stupid Parameters

To limit a time of headbanging solving weird JNLP descriptor behavior while passing properties to your app, remember that they are called "secure", i.e. starts from "jnlp." or "javaws." prefix. That means that <property name="foo" value="bar"/> won't work, while <property name="" value="bar"/> will.

Read them with System.getProperty(""); — as usual.

Sunday, December 06, 2009

Brain-dead laptop design by Dell

I mean... Just see it yourself how to change coin-cell battery in their 1525 Inspiron thing. Why would you do that? Because if the battery gone, your laptop won't boot at all (another utterly stupid brilliant bit of design by greatest Hell Dell).

Friday, December 04, 2009

Stop DHCP screwing up your Mac OS X hostname

I'v got Snow Leopard, but DHCP is screwing my hostname all the time to something very random. Another thing that /etc/hostconfig goes away, while System Preferences in the Sharing tab does not sets hostname as hostname. Thus all older recipes are not really applicable anymore, once you're on Snow Leopard (I love changes). The cure is how to setup your hostname to, e.g. "Zeus" (that's mine one) like this (terminal and sudo privileges are required):
sudo scutil --set ComputerName zeus
sudo scutil --set HostName zeus
sudo scutil --set LocalHostName zeus
That's it (no reboot really required).