title: CakePHP 2.1 JsonView
body: <p>I'm using the new CakePHP 2.1 and would like to use the JsonView to make my controller respond to an AJAX request created by jQuery on the client side.</p>
  
  <p>However, this should be done automatically with the JsonView according to the documentation.</p>
  
  <p><a href="http://book.cakephp.org/2.0/en/views/json-and-xml-views.html" rel="nofollow noreferrer">http://book.cakephp.org/2.0/en/views/json-and-xml-views.html</a></p>
  
  <p>I added this line in my routes.php file</p>
  
  <pre><code>Router::parseExtensions('json');
  </code></pre>
  
  <p>And in my controller I have</p>
  
  <pre><code>$this-&gt;RequestHandler-&gt;setContent('json', 'application/json' ); 
  $bookings = $this-&gt;Bookings-&gt;find('all');
  
  $this-&gt;set('bookings', $bookings);  
  $this-&gt;set('_serialize', 'bookings');
  </code></pre>
  
  <p>Then the view should be obsolete, but when I call this, it still serves a page which is pointing to a missing view.</p>