Dynamic Dashboard with PrimeFaces

I do a fair bit of work with the PrimeFaces JSF library and it is, IMHO, the best set of JSF widgets currently available. PrimeFaces has an excellent demonstration site as well which gives examples of the most common usage patterns of each widget available. Occasionally though it’s necessary to stray outside what is demonstrated and one such area is with backing beans. In the project I’m currently working on I need to make a dynamic dashboard and this is how I’ve done it.¬†Continue reading

Unable to set request character encoding to UTF-8

While developing my current application I’ve been seeing dozens of error messages like this:

WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /foo, because request parameters have already been read, or ServletRequest.getReader() has already been called and after searching high and low for a solution I eventually found one.Continue reading

Simple CRUD Example – Part 1

If you have ever developed a web application you’ll know that most of the code you write is not clever business logic that’s doing complicated calculations but actually fairly simple CRUD (Create, Reuse/Retrieve, Update, Delete) code. Since this is the type of code that gets written all the time it makes sense to know it inside and out and make sure it’s correct and optimized. This series of articles takes you through the creation of a simple CRUD application using the following technologies:Continue reading

JPA2 Serialized Blob Never Really Null

This one got me late on a Friday (actually after work so I was doubly frustrated) and is to do with how JPA2 persists attributes of items that are not of basic Java types and which are also not entities. In order words attributes that implement Serializable and get shoved into BLOB fields.Continue reading

Installing Maven on Ubuntu 11.10

For some reason I can’t possibly fathom Linux seems to have a downer on all things Java. Packages are available for most things but they are invariably not the latest version which means performing a manual install – not the end of the world but irritating when you can just install a package for most things. This page gives a quick overview of how to install Maven 3 on Ubuntu 11.10 but the same (or a very similar) process will work on most distributions.Continue reading

Glassfish 3.1 Exception While Loading

I recently switched over to using GlassFish 3.1 and then 3.1.1 from 3.0 and I so wish I hadn’t. The 3.1 release doesn’t seem to have bought any new toys but it’s brought a whole host of bugs and weird behaviour. The latest piece of oddness described here has just wasted a couple of hours of my life so in the hope that you won’t also have to waste your life here’s the problem.Continue reading

Maven Build Problem with JDK 7

I recently upgraded my system from Java 6 to Java 7. Over all I’m really pleased with the improvement I’m seeing from Java 7 but the upgrade has come with a little cost. For some reason I’m getting a failure in NetBeans when I try to deploy one of the web applications that I’m working on.Continue reading

Job Scheduling – The Timer Service

Most non-trivial applications require at least some asynchronous¬†processing but direct use of the thread library is not allowed in a JEE container environment. To get around this limitation EJB 2.1 introduced a timer service which, although functional, wasn’t very feature rich. This has finally been fixed in EJB 3.1 which brings a new, annotation driven, timer service to allow asynchronous processing. The new EJB 3.1 timer service takes it’s inspiration from the familiar Unix cron service so it should be familiar to a large number of people.Continue reading