Loom integrates with Jackson to provide the best possible JSON marshalling and unmarshalling:
// return a JSON response
public Resolution doFoo() {
return json(myObject);
}
// receive JSON objects as parameters
public Resolution bar(@JSON @QueryParam("baz") MyObject baz) {
/* ... */
}
<!-- render as JSON inside a page -->
public Resolution doFoo() {
return forward("mypage.jsp").setAttribute("bar", bar);
}
<script>
alert(${l:json(bar)});
</script>