controller.registerHandler(GET, "/_view/{index}/{type}/{id}", this);
controller.registerHandler(GET, "/_view/{index}/{type}/{id}/{format}", this);
}
public void handleRequest(final RestRequest request, final RestChannel channel) {
ViewRequest viewRequest = new ViewRequest(request.param("index"), request.param("type"), request.param("id"));
if (request.hasParam("format")) {
viewRequest.format(request.param("format"));
}
// we just send a response, no need to fork
viewRequest.listenerThreaded(false);
// we don't spawn, then fork if local
viewRequest.operationThreaded(true);
client.execute(ViewAction.INSTANCE, viewRequest, new ActionListener<ViewResponse>() {
public void onResponse(ViewResponse response) {
try {