spring-framework / org.springframework.http.converter.json / MappingJackson2HttpMessageConverter / setPrefixJson

setPrefixJson

open fun setPrefixJson(prefixJson: Boolean): Unit

Indicate whether the JSON output by this view should be prefixed with ")]}', ". Default is false.

Prefixing the JSON string in this manner is used to help prevent JSON Hijacking. The prefix renders the string syntactically invalid as a script so that it cannot be hijacked. This prefix should be stripped before parsing the string as JSON.

See Also
#setJsonPrefix