Class JsonUtil


  • public final class JsonUtil
    extends Object
    Utilities for writing JSON payloads to HttpServletResponse.
    • Constructor Detail

      • JsonUtil

        public JsonUtil()
    • Method Detail

      • writeErrorToResponse

        public static void writeErrorToResponse​(org.springframework.security.core.AuthenticationException e,
                                                javax.servlet.http.HttpServletResponse response)
                                         throws IOException
        Throws:
        IOException
      • writeErrorToResponse

        public static void writeErrorToResponse​(Exception e,
                                                javax.servlet.http.HttpServletResponse response)
                                         throws IOException
        Throws:
        IOException
      • writeErrorToResponse

        public static void writeErrorToResponse​(int status,
                                                String message,
                                                javax.servlet.http.HttpServletResponse response)
                                         throws IOException
        Throws:
        IOException
      • writeToResponse

        public static void writeToResponse​(org.json.JSONObject json,
                                           javax.servlet.http.HttpServletResponse response)
                                    throws IOException
        Throws:
        IOException