Archive for the 'Java' Category

May 18 2013

Changing Play 2 DB Configuration At Runtime: Beware of Dragons

Published by under Java,play framework

Maybe you work for a company that leaves DB passwords in plaintext in configuration files on their servers. You would probably be among the majority. Or maybe your company encrypts passwords in configuration files: Also not that uncommon. What’s not common (in my experience) is having the devops team “transmit” the password to the application after it has already been started. It’s a reasonable requirement, but out of the box, Play 2.1 presents several hurdles.
Continue Reading »

2 responses so far

Apr 29 2013

Play 2.1 Addendum

Published by under Java,play framework

In my previous post, Play 2.1: The Bloom Is Off The Rose, I talked about several real-world problems I’ve had when using Play 2.1. I’ve since received responses from the Play team which prompted me to continue trying to find solutions to my problems. The outcome is a mixed bag.
Continue Reading »

One response so far

Apr 21 2013

Play Framework 2.1: The Bloom is Off The Rose

Published by under Java,play framework,Web

Update: This post has gotten a lot more attention than I expected and I just want to say to those reading: Thanks for stopping by!

On a recent project, my team evaluated several web frameworks for an upcoming web application. We chose The Play Framework. I was very attracted to its simplicity and the rapidity with which we could get things working. The Scala templates are also very powerful and much simpler (for me at least) than JSP templates. All in all it seemed like a match made in heaven. We were all really enjoying working with it. Unfortunately the honeymoon ended shortly thereafter.
Continue Reading »

29 responses so far

Dec 07 2011

Windows CoffeeScript Auto-Compiler using Groovy and JDK 7 WatcherService

Published by under CoffeeScript,Groovy,JDK 7

Update: Node.js for Windows has been improved since this post, so this information is obsolete. Last time I checked I was able to run CoffeeScript the same on Windows as I do on Linux and OSX.

If you’re using the CoffeeScript compiler for Windows (By Alexey Lebedev) you’ve probably noted a lack of a -w or “–watch” argument. These arguments can be very handy if you are working with a coffeescript file and want to quickly see the results of your edits. Given this lack of functionality and my desire to write some code in Groovy 1.8 using some of the NIO2 JDK 7 features I decided to write a little script that wraps this CoffeeScript compiler and fills in this missing feature.
Continue Reading »

2 responses so far

Feb 26 2010

Spring 3.0 REST Release Update

Published by under Java,REST,Spring

In December 2009 I talked about getting a RESTful web service up and running using Spring 3.0.0.RC3. Since then Spring has had 3.0.0.RELEASE and 3.0.1.RELEASE. One of these releases caused my code example from this post to fail, so I’ve re-worked it and tested with Spring 3.0.1.RELEASE. Continue Reading »

2 responses so far

Dec 01 2009

Spring 3.0 RESTful Web Services By Example

Published by under Java,REST,Spring

Update:See this post for an updated code example that works with Spring 3.0.1.RELEASE.

If you’re reading this then you’re probably aware that the new Spring 3.0 release will have REST support (If you’re not familiar with REST here is a nice intro).  In this article I’m going to describe the basic steps required to quickly get a RESTful XML web service going using the latest Spring 3 release candidate (3.0.0.RC3).  In future follow-up articles I will describe how to switch between JSON and XML using selectors and how to use the Spring REST Template to read RESTful web services.
Continue Reading »

31 responses so far

Nov 27 2009

Closures Are in Again

Published by under Java,News

According to Sun, the controversial language feature, Closures, that was previously removed from the JDK 7 feature list has now been added in again (via).  I’m looking forward to the JSR on this one.  While I can’t see it being more elegant that using Scala, it will definitely make certain algorithms much nicer to implement in Java.

Comments Off

Jul 24 2008

Useful Java Utilities and Frameworks

Published by under Java

There are so many useful Java frameworks and utilities out there that are free and open source that it boggles the mind. Here are a few of my recent favorites. Feel free to add your own to the list. There are many many more that I did not add to this list because they are very common (e.g. log4J, JUnit, etc.)
Continue Reading »

4 responses so far

Apr 08 2008

Using Apache Commons DBUtils and DBCP

Published by under Java

For a project recently, I had the pleasure of working with both DBUtils and DBCP (Database Connection Pooling) from the Apache commons libraries. Both of these libraries together helped me to quickly create a simple, extensible DAO layer for my project. Both libraries include some great default features that I used right out of the box, without any configuration or fuss. In the post I’ll be talking about, and showing an example of using DBUtils. I will also show a quick and easy way to get a DataSource using DBCP.
Continue Reading »

2 responses so far

Dec 21 2007

Using the New java.io.Console Class

Published by under Java

The 1.6 release of the JDK included a new java.io.Console class, which adds some new features to enhance and simplify command-line applications. Notably, Console includes a method specifically for reading passwords that disables console echo and returns a char array; both important for security.
Continue Reading »

11 responses so far

Next »