Versioning REST APIs is a hot topic these days. In this post, I will show you how versioning with a custom Accept header works in Jersey, without going into the politics of which versioning approach is the best. I will build on the project from one of my previous posts on rest.
CODEBIAS
- thoughts and notes on programming.
Sunday, March 2, 2014
Saturday, November 9, 2013
Troubleshooting in Java
This post is just a collection of troubleshooting tips that I've picked up during the years.
Sunday, April 14, 2013
Environment configuration property injection using Java CDI
In Spring Framework, injecting environment properties is made simple using the context:property-placeholder
to configure property file locations and the @Value("#{propKey}")
annotation to specify the key of the property.
Java CDI does not have an equivalent out-of-the-box, but it's flexible and rolling your own is easy using a single qualifier
and a producer method.
Monday, March 18, 2013
How-to: RESTful Web services with JAX-RS and Spring
When providing services in a specific technology (i.e. EJB, JAX-WS, JAX-RS), it's wise to avoid mixing the business logic of your service and the technology that you are using to expose it to the outside world. This separation facilitates easier adoption of newer technologies and makes it easier to maintain and test services.
Tuesday, March 12, 2013
Testing Java classes with field injections
Dependency injection frameworks in Java give us 3 points of injection: constructor, field and setter methods. Many of us prefer field injection because we can skip writing setter methods and keep the number of lines to a minimum. The downside of field injection is that the class no longer can be used or tested without a dependency injection framework, for instance during unit-testing. In this post, I'm going to look at how we can unit-test a class with field injections.
Sunday, February 17, 2013
Working with JAXB for binding XML
Here are a few snippets for binding Java objects to XML using JAXB.
Sunday, February 10, 2013
Apache Wicket 6.5 vs. JSF 2.0
Having developed several web applications with JSF, and recently with Apache Wicket, I want to share my experience. On the web, Wicket has mostly positive buzz, but JSF seems to be hated by many (See http://ptrthomas.wordpress.com/2009/05/15/jsf-sucks/). I beg to differ.
Before I start, it should be noted that many of the frustrations and limitations of JSF discussed around the web have been have been addressed in version 2.0. And one more thing, the comparison aspects below are in no particular order.