It’s a common misconception that every program needs documentation. Most people seem to be terribly scared by programs lacking documentation. Whenever I am asked where my documentation is, inevitably this question is followed by the next question: “What happens if you leave the company? Nobody´ll be able to figure out your code!”
This is a nice little trick a collegue of mine found out. Consider a JSF page that uses a major backing bean. Suppose it takes a long time to initialize this bean (e.g. because huge amount of data have to be loaded from the database). The JSF page is shown when the backing bean has been initialized completely.
You can also use Primefaces
remoteCommand to implement a better and simpler possibility to do lazy loading.
Liferay has a nice feature to influence the portals behaviour by deployable items. Among other things you can use theese “hooks” to call a java method if the user logs in or logs off again. My particular use case was to show different pages to different user groups.
Hooks are described nicely at http://www.liferay.com/de/community/wiki/-/wiki/Main/Portal+Hook+Plugins. Unfortunately this description is a little outdated. For the sake of convenience I jot down the basic steps to write a hook.
This is the first part of a multipart series showing you how to make writing JSF page more fun. You will get better results writing less code.
Let’s have a look at a simple, yet typical form consisting of a single input field:
We have to write three lines of code to implement one input field. Looking carefully at the code, you will see the repetitions:
Today I tried to convert a couple a Java classes to Groovy. Groovy is just Java on steroids, I thought, so this should be pretty simple. Just change the file name extension and be happy.
Alas! My project was sparkled with red dots. There are subtle differences between the languages I did not notice before.
Theese days we had some difficulties updating the libraries we used. We had to update them pretty often, sometime twice a week. So I was looking for a neat way to update the libraries on my collegues’ computers without blocking their work.