protected Object readJson ( final InputStream is , final Class cl , final HttpServletResponse resp ) throws ServletException { if ( is == null ) { return null ; } try { return getMapper ( ) . readValue ( is , cl ) ; } catch ( Throwable t ) { resp . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; if ( debug ( ) ) { error ( t ) ; } throw new ServletException ( t ) ; } }
Parse the request body and return the object .