terrestris/shogun — pull request #59 by buehner (2014-09-23 13:15:34+00:00)
Title: Upgrade Jackson from v1 to v2

I suggest to update the Jackson framework from version 1 to version 2 as you get (Spring web controller JSON serialization) problems if a SHOGun-based project has dependencies on other libraries that use jackson in version 2 (like the mapfish print lib in its latest release). In such cases, Spring would use the `MappingJackson2HttpMessageConverter` (as Jackson2 is available on the classpath) instead of `MappingJacksonHttpMessageConverter` for the JSON-serialization.

As the package name changed between v1 and v2 from `org.codehaus...` to `com.fasterxml...`, the Java classes have been adapted in this pull request.

***Attention:***

You should be careful if you are referencing the SHOGun (HEAD-) sources (or upgrading to them) in an existing SHOGun-based project (e.g. via `svn:externals` or similar). In such cases, you will eventually have to adapt the import declarations of your code (analogue to the changes in this PR). You should also know that the (default-) behavior of the `JsonIgnore` annotation has changed a little bit:

Imagine a web controller that returns a Map:

```
public @ResponseBody Map getSomeContext(...){...}
```

Furthermore we assume to have an entity class that makes use of the `JsonIgnore` annotation:

```
public class MyEntity {

String a;

@JsonIgnore
String b;
}
```

If we now put an instance of `MyEntity` to a map that will be returned by the controller from above, there are differences between Jackson 1 and Jackson 2:

- Jackson 1 will serialize the `String b` although it is annotated with `@JsonIgnore`
- Jackson 2 will **not** serialize the `String b`

Please review and feel free to merge this PR!