Default HTML-escape using Freemarker

Most java developers have at least heard of Freemarker. FreeMarker is a “template engine”; a generic tool to generate text output (anything from HTML to autogenerated source code) based on templates. It’s a Java package, a class library for Java programmers. It’s not an application for end-users in itself, but something that programmers can embed into their products. It is the “generic” nature of Freemarker that trips up java web developers....

Jsoup - BeautifulSoup for Java

HTML is notoriously difficult to parse and it has usually been a pain to do this in Java. Yes I know that there are parsers (like jtidy and nekohtml) that try to create a proper DOM but I’ve been waiting for something more lightweight. Enter Jsoup. It feels like a mix of JQuery and Beautiful Soup (for Python). String html = response.getContentAsString(); Document document = Jsoup.parse(html); Elements elements = document.select("#errorRef"); assertThat(elements....

JPasskeep and Command-Q on Mac

I've released a new version of my long-running password keeper application: JPasskeep. This new release is now able to handle a Command-Q keystroke on the Mac, giving a user (i.e. me) an chance to save any updated entries. No more mousing around to close a window. The actual mechanism to do this was to reflectively call Apple's EAWT application classes to allow me to register the correct event listener. Hmm, run anywhere with java GUI apps....

JPasskeep Update

Just finished a new version of my long-running password keeper application. You can download the cross-platform version, the mac dmg image, and the source code. New changes include the ability to export entries to an encrypted HTML page (see my previous post on javascript cryptography) and bundling the cross-platform version as a single JAR file using one-jar. As usual this version does not rely on javax.crypto APIs to function so it should work wherever a JDK5 compatible VM can run....