title: CakePHP Ajax Request not going Internal Server Error
body: <p>I am just trying to test ajax form submit in CakePhp. I have below written code. But ajax is not working.</p>
  
  <p>Error in chrome : 
      <strong>POST <code>http://localhost/john/Frontends/AjaxFormSubmit</code> 500 (Internal Server Error)</strong>   </p>
  
  <p><strong>View File</strong></p>
  
  <pre><code> echo $this-&gt;Form-&gt;input('appendedInputButton',
           array('id'=&gt;'url','name' =&gt; 'AjaxFormSubmit', 'type' =&gt; 'text')); 
  
   echo $this-&gt;Form-&gt;button('Convert',
           array('id' =&gt; 'Convert', 'type' =&gt; 'button'));
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$(document).ready(function () {
  
      $('#Convert').on({
          'click': function () {
              var urlVal = $("#url").val();
              if (urlVal == '' || urlVal == 0) {
                  $("#url").focus();
                  return false;
              }
  
              $.ajax({
                  url: 'http://localhost/john/Frontends/AjaxFormSubmit',
                  cache: false,
                  type: 'POST',
                  success: function (data) {
                      alert(data);
                  }
              });
          }
      });
  });
  </code></pre>
  
  <p><strong>Controller</strong>    </p>
  
  <pre><code>App::uses('AppController', 'Controller');
  
  class FrontendsController extends AppController {
  
      public $name = 'Frontends';
      public $uses = array();
      public $components = array('RequestHandler');
      public $helpers = array('Html', 'Form');
  
  
      public function index() {
          $this - &gt; layout = 'frontend_index_layout';
      }
  
      public function AjaxFormSubmit() {
          echo "Receiving Via Ajax";
      }
  }
  </code></pre>
  
  <p><strong>Error Log File</strong></p>
  
  <pre><code>2013-08-13 13:41:43 Error: [MissingControllerException] Controller class JsController could not be found.
  Exception Attributes: array (
    'class' =&gt; 'JsController',
    'plugin' =&gt; NULL,
  )
  Request URL: /john/js/jquery-1.10.1.min.map
  Stack Trace:
  #0 G:\wamp\www\john\app\webroot\index.php(111): Dispatcher-&gt;dispatch(Object(CakeRequest), Object(CakeResponse))
  #1 {main}
  2013-08-13 13:42:01 Error: [MissingViewException] View file "G:\wamp\www\john\app\View\Frontends\Ajax_Form_Submit.ctp" is missing.
  Exception Attributes: array (
    'file' =&gt; 'G:\\wamp\\www\\john\\app\\View\\Frontends\\Ajax_Form_Submit.ctp',
  )
  Request URL: /john/Frontends/AjaxFormSubmit
  Stack Trace:
  #0 G:\wamp\www\john\lib\Cake\View\View.php(468): View-&gt;_getViewFileName(NULL)
  #1 G:\wamp\www\john\lib\Cake\Controller\Controller.php(948): View-&gt;render(NULL, NULL)
  #2 G:\wamp\www\john\lib\Cake\Routing\Dispatcher.php(194): Controller-&gt;render()
  #3 G:\wamp\www\john\lib\Cake\Routing\Dispatcher.php(162): Dispatcher-&gt;_invoke(Object(FrontendsController), Object(CakeRequest), Object(CakeResponse))
  #4 G:\wamp\www\john\app\webroot\index.php(111): Dispatcher-&gt;dispatch(Object(CakeRequest), Object(CakeResponse))
  #5 {main}
  </code></pre>