Jongo, query in Java as in Mongo shell

Mongo — the document oriented NoSQL database supported by 10gen — offers a compact, easy to learn and well documented query language. Unfortunately, using Mongo with its Java driver can be tricky: querying, mapping results and handling polymorphism require lots of code. Some libraries aim to simplify this (like Morphia), but none allows to query in a shell fashion. Jongo tries to fill that need, querying with the use of strings and unmarshalling results into Java objects.

Read more →

HTTP Authentication and Security with Apache Shiro

Authenticating users is an important part of an application. Limiting the access to resources with authorization too. Spring Security is a reference in web environment. However, it is tied to the Spring technology and the size of the library — more than 10 JAR of dependencies — may restrain its use. Moreover, its lack of integration with Guice or the recurrent deployment of an App Engine application may exclude it. This is the opportunity to take a closer look at Apache Shiro.

Read more →

JAXB, XML Data Binding

As an ubiquitous exchange format, XML is well implemented in java. But those implementations hide how they perform the data binding from a XML structure to an object graph. It leaves us helpless in front of an application giving XML as a plain old string. Because low level API (DOM, XPath) — focused on document structure — are tedious, major JAX-RS implementation (Jersey, CXF) have chosen the same high level API — focused on data —: JAXB. Let’s do the same.

Read more →