response.contentType("application/json; charset=UTF-8").print( jsonMessages.toString() );
}
}
public void applications(Request request, Response response) throws JSONException {
Value from = request.getParameter("recipient");
Value status = request.getParameter("status");
Value numRecords = request.getParameter("numRecords");
Collection<Message> messages = listMessages(Direction.TO_APPLICATIONS, "from", from, status, numRecords);
boolean htmlResponse = request.getHeader("Accept").contains("text/html");
if (htmlResponse) {