Category Archives: java

Configuring Spring Integration channels without XML

I’ve been looking at some messaging frameworks lately and trying to find something that’s not too obtrusive. Spring Integration seems straightforward, plays nicely with our other Spring stuff, and runs in your application, which is a plus for us, but … Continue reading

Posted in java, software | Tagged | 4 Comments

Adding an https connector to embedded Tomcat 7

The api to add https support to an embedded tomcat server follows the corresponding server.xml elements pretty closely. For example: Connector httpsConnector = new Connector(); httpsConnector.setPort(443); httpsConnector.setSecure(true); httpsConnector.setScheme(“https”); httpsConnector.setAttribute(“keyAlias”, keyAlias); httpsConnector.setAttribute(“keystorePass”, password); httpsConnector.setAttribute(“keystoreFile”, keystorePath); httpsConnector.setAttribute(“clientAuth”, “false”); httpsConnector.setAttribute(“sslProtocol”, “TLS”); httpsConnector.setAttribute(“SSLEnabled”, true); … Continue reading

Posted in java, software | Tagged | 6 Comments

How to find a file’s image type by looking at its bytes (in Java)

Byte arrays and byte streams get used a lot in java, but it’s rare to do anything with individual bytes. Many file types start with certain bytes, though, and can be quickly identified by them. In my case, I had … Continue reading

Posted in java, software | Tagged | 6 Comments

Tomcat and Servlet 3.0 Web Configuration

Tomcat 7 is now in production, and one of its new features is support for Servlet 3.0. Servlet 3.0 is…well, hard to remember what’s in there. But actually, it does have some ease of deployment features that open up the … Continue reading

Posted in java, software | Tagged | 3 Comments

How to create QR Codes in Java

Bar codes aren’t just for cereal boxes any more. 2-D barcodes like QR Codes are easily read by smart phones and are showing up everywhere from magazines to restaurant fronts to business cards. With some of the open-source libraries out … Continue reading

Posted in java, software | Tagged | 16 Comments

Introduction to Amazon’s SimpleDB

Amazon’s SimpleDB is a NoSql datastore with a whole lot of no: no sql, no datatypes (except utf-8 strings), no transactions, no joins, no indexes, no schema, no administration, and no cost for minimal usage. But when you google it, … Continue reading

Posted in cloud, java, software | Tagged | 7 Comments

Java Code Coverage: Cobertura vs. Emma vs Clover

The last time I looked for free java code coverage tools, I found EclEmma for Eclipse and Cobertura for automated builds through ant or maven. They’re both good tools, but they come up with slightly different numbers. Maybe I just … Continue reading

Posted in java, software | Tagged , | 10 Comments

Google’s guava java: the easy parts

Google’s guava is one of the best, most useful all-purpose java libraries to come out in a long time. It’s surprising that it isn’t standard in most projects now. Maybe there’s too much in there. If the functional and concurrency … Continue reading

Posted in java, software | Tagged | 11 Comments

Embedding Tomcat 7

One of the more anticipated features of Tomcat 7 is the ability to run as an embedded server like Jetty. We use Tomcat 6 in production, but embedded Jetty more and more for running and testing during development (in Eclipse). … Continue reading

Posted in java, software | Tagged | 45 Comments