The JSON plugin provides a json result type that serializes actions into JSON. You will find more details in documentation.
Just drop this plugin JAR into WEB-INF/lib folder or add it as a Maven dependency.
WEB-INF/lib