code: public ChannelFuture respondJsonP(Object ref, String function) throws Exception {
          final String json = jsonObjectMapper.writeValueAsString(ref);
          final String text = function + "(" + json + ");\r\n";
          return respondJs(text);
      }
docs: Converts the given Java object to JSON object using Jackson ObjectMapper,
  wraps it with the given JavaScript function name, and responds.
  If you already have a JSON text, thus no conversion is needed, use respondJsonPText.
  <p>
  Content-Type header is set to "application/javascript".