The Daily Bugs

A web developer's daily life

Category / Tutorials

September 28, 2013

Handling Java Generic Types with Reflection

When declaring a class or an interface as being parameterizable, or when a subclass extends that parameterizable class, we come into cases where we need to access the information of those generic parameters, this is where Java Reflection comes in handy. This tutorial will introduce ReflectionUtil, a utility class that uses java.lang.reflect standard library. It …

Read More
July 10, 2013

Date Range Validation with PrimeFaces Calendar

PrimeFaces <p:calendar> has some good attributes like mindate and maxdate, considering we have two calendars “start” and “end”, to validate a proper date range between them, we can set the mindate of “end” calendar to the value of “start” calendar. This will do a good job, but not a complete one, still when you edit …

Read More
April 19, 2013

Caching and reusing an evaluated EL expression in JSF

Sometimes you run into a scenario where you have an evaluated EL expression property, that is used widely through your JSF page. Evaluating the value each time is a waste of performance. JSTL core <c:set> helps you caching the value into a scoped variable, that can be accessed later on through the scope it’s defined …

Read More
April 18, 2013

Clickable PrimeFaces Wizard Tabs

PrimeFaces wizard component <p:wizard> is awesome, but recently in my work I was asked to get the tabs clickable, which are not by default in version 3.5. This is a full tutorial explaining how you can achieve this.

Read More
August 29, 2011

Java Localization with PropertyResourceBundle

A tutorial about PropertyResourceBundle object and .properties files; how to create them, load their values, use them in business logic code, or JSF view page. This tutorial will try to gather all the uses in one place.

Read More
July 15, 2011

Resizing java.awt.Image with constraining proportions using ImageUtil

With every application I create, I always come into image manipulation, which can be really tricky in Java and sometimes even complicated. The function that was always needed is to resize an image after the client user uploads it, or reduce its quality. As you know when ever you feel like a function needed over …

Read More
July 6, 2011

Adding Richfaces 4.0.0.Final Libraries to Your Project

Richfaces 4.0.0.Final is out there, and so far it’s pretty useful as usual, but when I wanted to add it in my NetBeans project on JSF 2.1.2, many exceptions, many unrecognizable stack traces. I started googling, after hundreds of results and surfing I ended up with collecting what I needed to get it working, and …

Read More
February 6, 2011

Installing PHPUnit with MAMP

Installing PHPUnit can be a little bit complicated with MAMP specially if you were running through incompatible versions. I got it running after twisting my mind for many hours searching, so it deserves a full tutorial. You’ll install PHPUnit using “Pear” installer and we’ll use the one that came with MAMP not the one with …

Read More
Older Posts