About

Personal Photo Origins :
Manchester, UK

Location :
Manchester, UK

Available for work :
January 2015


Contact Me

I've been developing software for over 15 years working in Delphi and now Java. This site is a home for my open source projects, writings, articles and tutorials mainly focusing on Java and Java EE.

Ohloh profile for andygibson

Archives

By Andy Gibson • October 27th, 2014 • in Personal 3 Comments

Its been 2 years since I last posted and a a lot of water has passed under the bridge since then. I’ve moved three times to two different US states, changed jobs, started a cub scout pack, coached under 8s soccer for a year, and spent 8 months on various DIY projects including renovating 3 bathrooms, a laundry room and kitchen ceiling, and 2 months selling my house. After all that I have finally moved back to Manchester in the UK which is where I am from originally.

Now that things have quietened down a bit, I’m going to start looking at writing some more posts. Technology-wise, I’ve been mainly going where my work has taken me, which has mostly been Spring, some EJB, JSF and GWT. Future blog posts are more likely to be technology agnostic, but there will be posts dealing with specific technologies and how-tos.

I personally enjoy reading longer and more in-depth posts or articles, and in general I enjoy writing them, but writing, proof-reading and re-reading takes a lot of time. As I only have a few hours to spend on non-work projects, I’m hopefully going to try and reach a balance with shorter posts more frequently (although brevity is often not in my nature).

This article shows how you can leverage JPA Lifecycle Events to automate the filling in of audit information. The first example uses a base entity class with lifecycle events that looks for a time stamp interface to determine whether the entity is audited.
(more…)

Despite the fact that there are plenty of free languages and development tools available online, there is still a much larger barrier to entry for someone who wants to get started as a programmer compared to nearly 30 years ago. I have fond memories of the computing of the 80s so I thought I’d take a quick trip down memory lane and write about my personal exerience of becoming a programmer. It may also be of interest to those familiar only with the Silicon Valley version of the history of computing since this covers events from the other side of the pond in the UK. When historians talk about the history of computing, they really only cover things like the TRS80, Altair and rise of the PC and Mac, yet there were many important and competitive developments in Europe that are often not included as part of this history.

(more…)

I was trying to fade in a Primefaces panel component that was initially hidden and found it to be somewhat of a struggle. After a bit of googling, the only thing I found out was that I wasn’t the first to come across the problem. Here’s the basic JSF code to use an effect on a panel in response to the button click.

<p:button id="showme" value="Show Me" onclick="return false">
	<p:effect type="fade" event="click" for="myPanel"/>
</p:button>

<h:panelGroup layout="block" id="myPanel" style="display:none">Show Me</h:panelGroup>

This code does nothing because by default the fade effect fades out the component. Looking at the options for the fade gives us no clues either since it claims there are no parameters. The solution is to provide a mode parameter that can be either show or hide which is used for most of the effects. In our case, we want to show the component.

<p:button id="showme" value="Show Me" onclick="return false">
	<p:effect type="fade" event="click" for="myPanel">
		<f:param name="mode" value="'show'"/>
	</p:effect>
</p:button>

<h:panelGroup layout="block" id="myPanel" style="display:none">Show Me</h:panelGroup>

This will show the panel that was initially hidden when you click the button. The only nagging problem is that the button retains its hover style until you click elsewhere in the page.

There’s still a lot of confusion over the difference types of managed beans provided in Java EE 6 with EJBs, CDI beans and JSF managed beans all being available. This article aims to clear up some of the differences between the them and define when to use them. (more…)

In this second article on implementing Spring MVC in Java EE 6 we’ll take the metadata we extracted in part one and use it to invoke request mapped controller methods in response to web requests and then direct the user to a web page based on the result of the method. (more…)

One of the opinions I’ve had over the last couple of years is that Spring makes things look really easy, and CDI is a great dependency injection framework. Throw in this article suggesting you can build your own Java EE 7 and it sounds like a challenge, so for fun, I thought I might have a go at implementing a subset of Spring MVC on top of CDI with Java EE 6. (more…)

So I’ve been meaning to make a fix in one of my projects for a while, and I haven’t touched the code in over a year, so of course I have to go back and really get back up to speed with the code. The change was for the Datavalve project and it was to include support for passing in collections and using in SQL Statements, so now you can use something like :

provider.addRestriction("item.statusCode in (:param)", stateCodeList);

This will cause the list of codes to be expanded into an in SQL statement including checking to exclude null items, and as usual, the restriction is not included if the code list is null or contains only null items.

So I have two problems, the first is getting back up to speed on my code, figuring out where the make the change, and making it. The second is making sure my code changes don’t break anything thats currently working.

For the first problem, I decide to create the unit tests first so I can verify that the change does as expected. Obviously, the tests fail initially, but by looking at the code executed by the tests, I can start to pick out places where I need to start looking to add the new code. After all, tests measure the correctness of the state after the code has been executed. What better place to start looking than seeing what code the test executes. After finding the method that I need to change, I make my code changes and run my tests. All my original tests pass with flying colors, but my new test fails. I take a peek and sure enough I left off the last line of code to add the built object to a list. I put it in, and I have all my tests up and running.

All in all, I’ve made a large change to some sizable (12K+ LOC) code that I haven’t seen in over a year, verified that the change works and that it hasn’t impacted any other code. Not bad for an hour.

By Andy Gibson • October 25th, 2011 • in Personal No Comments

So I’ve been on a bit of break from blogging, I’ve had lots of things going on, I’ve moved house twice, and changed jobs a couple of times. I’ve not even really been checking my email that much (as evidenced by the fact that I didn’t see my hosting invoices and the subsequent temporary suspension of my blogging web site). I’ve been spending time with the family over summer and taking a bit of a break from the extra-curricular IT work. I’ve also been doing some thinking on which direction I want to go in my career. Because of all this, If you’ve emailed, or sent a LinkedIn request that I’ve done nothing with, that’s why. However, things have been hotting up in my absence so there’s certainly a lot of topics to delve into.

It seems in the last few weeks or so the Maven JSTL dependency has vanished from at least the central repository. This has caused a number of issues around the web.
(more…)