This demonstrates how to configure a Spring XML application to encode JSON rather than simply escaping it as recommended by OWASP XSS cheat sheet. Specifically it states JavaScript should be encoded as
Except for alphanumeric characters, escape all characters with the \uXXXX unicode escaping format (X = Integer).
You can run the application with the following:
./mvnw package cargo:run
Then access http://localhost:8080/