The Daily Bugs

A web developer's daily life

Tag / Java

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
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
Older Posts