Category: Java

  • Dynamic DataTable with JSF 2.0

    A project I’m working on recently presented me with the problem of totally dynamically creating a data table on a JSF page. At first sight I assumed this would be fairly trivial since I had created a number of other components dynamically with no problems. The difference though was that the other components (for example…

  • JSF Object Not Found

    I recently decided to try writing my own JSF component as I had a need that wasn’t met by the excellent PrimeFaces component library. I had read some horror stories about how hard it is to write custom components so I’d put off doing it as I didn’t want to get bogged down when I had so…

  • Programatically Adding Ajax Actions to UIComponents

    One of the projects I’m currently working on requires me to build a component tree dynamically. To complicate matters the components also require ajax functionality – in this case they are panels that need to be closed and notify a listener.

  • Dynamic Dashboard with PrimeFaces – Part 2

    After putting together the first page on writing a dynamic dashboard with PrimeFaces I descovered that the method I had come up with wasn’t as good as it could have been. Most noteably it didn’t work properly when the dashboard was updated via a partial page refresh. Typically that type of update would result in a…

  • 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…

  • 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.

  • Simple CRUD Example – Part 2

    In the last article I showed you how to create a Debry database and set up a persistence unit. In this article I’ll create a very basic CRUD application. Using JSF 2, JPA 2 and EJB 3.1.

  • 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…

  • Java 7 JDBC-ODBC Bridge on Windows 7 64bit

    That mouth full of a title sums up quite nicely what I’ve been trying to get working today: a JDBC-ODBC bridge connection to a 32bit Access database running on a 64bit version of Windows 7. Phew, I’m tired just thinking about it.

  • 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.

  • 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…

  • 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…