Sending files through action listeners

Date March 16, 2009

For this weeks JSF tip, I’ll show you how to send binary data (such as a file) to the user by way of an action handler or listener. Say, you want to generate a custom PDF and send it to the user as he clicks a link. You need a JSF page, and a backing [...]

JSF and I18N

Date March 9, 2009

It has been a busy year so far. Every year I start out thinking that I really need to relax because the previous year was too hectic, but every year it ends up being much more hectic. Anyway, I thought I’d post a JSF quick time that might shave some headache for people developing internationalised [...]

Setting JAVA_HOME on Ubuntu

Date December 31, 2008

A thing that always annoys me about installing Java is that it doesn’t automatically set up the JAVA_HOME environment variable after installation. I guess this is to avoid having problems when you have multiple virtual machines installed. Anyway, I use Ubuntu Linux to host the majority of my Java Application Server. It is easy install [...]

Getting value expressions from f:attributes

Date November 24, 2008

If you have a custom converter or validator you may provide these with the option of letting developers specify attributes. For example, let’s say that we are creating a converter that will allow the formatting of a Calendar object. Note, that the <f:convertDateTime /> is for Date objects (which can be easily retrieved from a [...]

Custom code folding in NetBeans

Date February 6, 2008

When you got large source files it can sometimes be helpful to create foldings for certain sections of your code. NetBeans got a nifty functionality for this using non-intrusive XML code (similar to Visual Studio). To create a custom code folding section simply insert the following before the content to fold: //<editor-fold defaultstate="collapsed" desc="My custom [...]

Concatenating strings in JSF

Date February 4, 2008

To start the day off I though I’d share a quick tip using JSF. Say you have a list of messages: quicktip.Messages: ITEM_1=First item ITEM_2=Second item ITEM_3=Third item Now, on your JSF page you would like to show one of these messages depending on the ID of the item to display. For example, you might [...]