I have recently started to build a public REST API with Java for Podcastpedia.org and for the JAX-RS implementation I have chosen Jersey, as I find it “natural” and powerful – you can find out more about it by following the Tutorial – REST API design and implementation in Java with Jersey and Spring.  Because Podcastpedia.org is a web application powered by Spring MVC, I wanted to integrate both frameworks in podcastpedia-web, to take advantage of the backend service functionality already present in the project. Anyway this short post will present the steps I had to take to make the integration between the two frameworks work.

Continue Reading ...

Transactions are omnipresent in today’s enterprise systems, providing data integrity even in highly concurrent environments. So let’s get started by first defining the term and the context where you might usually employ it.

Continue Reading ...

Recently I run into very interesting problem which I thought would take me just a couple of minutes to solve: protecting Apache CXF (current release 3.0.1)/ JAX-RS REST services with Spring Security (current stable version 3.2.5) in the application running inside embedded Jetty container (current release 9.2). At the end, it turns out to be very easy, once you understand how things work together and known subtle intrinsic details. This blog post will try to reveal that.

Continue Reading ...

Unlocking the Asynchronous Powers of JavaScript

When I got started working with Node.js and Express, one of the first things I had to really wrap my head around was JavaScript callbacks. This is a powerful functionality built into the language that allows you to defer action until a desired event occurs, while proceeding on with other activities.

The truth is, I’ve been using callbacks for a long time, I just didn’t really realize it. I work with jQuery constantly, and it’s designed with callbacks in mind, passing anonymous functions via its built-in methods to be triggered when certain events occur, for example. Still, I wanted to move beyond “I know this works” to “I know how this works” both with jQuery and JavaScript, so I dug out my copy of JavaScript: The Good Parts, did some reading, hit the web, did some more reading, and then wrote a few simple experiments.

I thought I’d write up a little tutorial to help folks who are new to the concept get started. Hope it’s useful!

Continue Reading ...

I spent most of my (little) career until now building web applications using the MVC pattern with action-based (Spring MVC, Struts2, Servelt/JSP) and component-based (Tapestry, JSF) Java technologies. It has always been a classical model where the client requests a server that responds with a HTML page. Of course, I have built ajax powered web apps but I never got the chance to develop a real time single page application with a modern Javascript framework like Angular, Backbone or Ember.

So I decided to give it a try by building ChessHub.io with a completely new technology stack and way of thinking:

  • Moving form Java to Javascript
  • Moving from SQL to NoSQL
  • Moving from multi-threaded Java servers to the single threaded NodeJS
  • Moving from classic MVC + Ajax to real time with ExpressJS and Socket IO
  • Moving from synchronous processing to an asynchronous model
Continue Reading ...