Symfony Ajax Controller Handler, always fires jQuery error function

I am really new with Symfony framework I am just trying to implement a simple ajax example:


    pattern:  /data/user
    defaults: { _controller: DartDartBundle:Data:user }
        _method:  POST


namespace Dart\DartBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;

class DataController extends Controller
    public function userAction(){      
        $content = array('success' => true, 'name' => 'luis');
        $response = new JsonResponse($content,200);
        $response->headers->set('Content-Type', 'application/json; Charset=UTF-8');
    return $response;

And the ajax call:

    type : 'GET',
    dataType: 'json',
    url : '',
    success : function(data){
    error: function (xhr, ajaxOptions, thrownError){   
        console.log("SOME ERROR OCURRED");

But it always fires the error function. I don't know why. I've try without specifying jston dataType and using Response instead of JsonResponse.

I don't know whats wrong.



Route is configured as POST - only

The Ajax request is a GET request

try to remove the requirement


Try to access the url directly in your browser to check if you configured the path right and you can access the controller.

The request is made from the same server but with a different domain. The request is not using any vhost or domain, its uses server's ip and the htdocs folder.

Symfony is placed in a folder which has a vhost alias and its accessed using a domain (i.e. The folder in the server is inside /DART root folder. So its ./DART/symfony....

The firebug info for either of the methods. For instance, for GET method:

Need Your Help

Java ME UI libraries

java java-me mobile

I'm developing a Java ME app & need pointers to some really good UI libraries. I did see a few such as Java ME Polish. Are there any more out there? For e.g. ebuddy's java ME app has an amazing...

NOT IN clause and NULL values

sql sql-server tsql null notin

This issue came up when I got different records counts for what I thought were identical queries one using a not in where constraint and the other a left join. The table in the not in constraint ha...