Skip to content

Spring Lemon Commons Web Guide

Sanjay Patel edited this page Nov 18, 2018 · 10 revisions

Under construction ..

spring-lemon-commons-web includes spring-lemon-commons, and adds Spring MVC (non-reactive web) application development features, which are discussed below.

Suffixing JSON responses with ")]}',\n"

To prevent some JSON attacks, many APIs like to suffix all their JSON responses with )]}',\n. Spring Lemon will do that for you if you just provide a property lemon.enabled.json-prefix, e.g. add this to your application.properties:

lemon.enabled.json-prefix=true

Exception Handling

The com.naturalprogrammer.spring.lemon.commonsweb.exceptions package contains classes that catch exceptions and then delegate the handling to the spring-lemon-exceptions module. Specifically, it has a controller advice, as well as overridden ErrorAttribute and ErrorController classes. Refer this for a detailed discussion.

Clone this wiki locally