Andy Pemberton
Sep 01 2010
I pulled down the latest IE9 platform preview yesterday to check its support for the W3C Geolocation API.
Unfortunately, it doesn't appear to be supported yet. I've seen rumors that it may be supported, but I'm not sure how to confirm.
In the mean time, I built a little application that will tell you if your browser supports W3C Geolocation and attempt to Geolocate you: http://www.andypemberton.com/geo/
Without IE9, that means Geolocation is supported by the following browsers:
Nov 13 2009
Spring 3 Example Portlet and Overview
Spring Source pushed the first release candidate of Spring 3 a little more than a month ago; it took a little longer than expected, but nonetheless I've been waiting on this release to play around with the new Portlet MVC features.
For portlet developers, the most notable enhancements are in the support for the Portlet 2.0 spec (JSR286), primarily offered through a new set of portlet-specific annotations. There are also various enhancements to Spring Core and Web MVC that will be useful on portal projects and standard java web projects.
I've built an example portlet application to show off some of these new features; it's downloadable below as a deployable WAR (tested on JBoss Portal 2.7.2) and a mavenized eclipse project (zip).
Sep 01 2009
While many languages have enumerations built into the syntax, Sun didn't add the construct to Java until Java 5. After tooling around with enums a bit (blog entries forthcoming), I got to thinking... What makes an Enumeration? How constant is a constant? Maybe it's the philosophy major in me, but these are questions worth answering (or at least pondering aimlessly).
No matter how you slice it, enums in Java have the downside of requiring recompilation to add additional values, so my aim here is to answer the question: when should you choose to use an enumeration?
Jul 13 2009
Knowing when to Apply a Design Pattern
I've been reading up on design patterns lately, particularly those in Core J2EE Patterns. Design patterns are great - they help software architects rely on the collective knowledge and experience gathered from past projects; they also allow designers, developers, and analysts to use a common language.
It occurred to me while flipping through the Core J2EE Patterns that several of them are either outdated or at least their utility has been diminished by advances in JavaEE. (Not to mention that this may mean some of the Core J2EE 'patterns' are too implementation specific and may be better labeled as strategy than pattern).
After seeing a pretty funny blog entry last week on Dart-board Driven Design, I thought I'd finish off a blog post I started on deciding when to use design patterns.
My argument is that the cost of the additional layer of 'pattern' code should be outweighed by the value the pattern delivers; further, you must evaluate the value when implementing any pattern.
Apr 21 2009
JSR286 Tag Library and XML Escaping
It always bothered me that the JSR168 <portlet:actionURL /> and <portlet:renderURL /> tags didn’t encode their HTML character entities. The lack of encoding causes your HTML 4 or XHTML 1 markup to fail automated validation. After flipping through a bit more of the JSR286 spec, it mentions that in JSR168 “the behavior in regards to XML escaping URLs written by the tag library was undefined” 1. So, some vendors may have encoded and some may not have (as of 2.7 JBoss Portal, for example, does not).
