Category Archives: Java

Guice / Java IoC best practices – using annotations for configuration

18 months ago I introduced Guice 2.0 into my workplace development team. So far it has been doing a good job of making inversion of control / dependency injection approachable, light-weight and helpful for the whole team. The biggest issue … Continue reading

Posted in Java, Software Engineering | Tagged developer, Google, guice, Java, tips | Leave a comment

Java String “substring” – an example of lazy error messages…

What does this error mean? Exception in thread “main” java.lang.StringIndexOutOfBoundsException: String index out of range: -1 That’s easy right? You’ve passed “-1″ as an argument to a Java String’s “substring” method. Wrong. Here’s some code that gives the same error … Continue reading

Posted in Java, Software Engineering | Tagged Java, soap-box | 2 Comments

Adding a Dynamic Watermark to an Image – Java Web Application

I recently had to come up with a way to add a dynamic watermark to images served in a Java web application. This was able to be done pretty easily in a Java Servlet Filter using the regular AWT toolkit. … Continue reading

Posted in Java, Software Engineering | Tagged images, Java, web | 4 Comments

Clustering Guice Java Web Applications

Considering the origin of Guice (it’s use in Google Adwords, one of the largest apps on the Internet), it’s fair to say it should support clustering / session replication. There’s not much in the way of documentation around that aspect … Continue reading

Posted in Java, Software Engineering | Tagged cluster, guice, Java, tips | Leave a comment