1

I have one jsp page, on load of jsp, two radio button is there, on click of first radio button, i am doing an ajax call with no data and it will go to controller and method will return a list object but it is not even hitting the controller method

My ajax code is like this :

 $("#radio1").click(function(){
    alert('success');   
    debugger;
    $.ajax({
        method : 'GET',
        url : 'ConnectionStringDetails',
        data: {},
        success: function(data){   
            alert('True');

        },
        error: function() {
            alert('unsuccessfull');
            }
    });   

and controller method is like this:

@RequestMapping("/ConnectionStringDetails")
@ResponseBody
public List<ConnectionString> ConnectionStringDetails()
{

    List<ConnectionString> conndetail=null;
    System.out.println("ConnectionStringDetails");

        conndetail=bdpService.getSourcesData();

    return conndetail;
}
8
  • what does the browser network call view show? Commented Nov 23, 2015 at 14:12
  • Need more details... Do you have any mapping on the controller? How are you running the app? Do you have web.xml? What url do you see in the browser debugger? Commented Nov 23, 2015 at 14:26
  • @Rohit : it is not showing any data in n/w call view, just showing the method name i.e ConnectionStringDetails Commented Nov 24, 2015 at 6:36
  • @jny, yes, web.xml is there but m using RequestMapping annotation for mapping and same passing in url of ajax call, other ajax calls in project in which m passing data is working, only this one (with no data), is giving problem. Commented Nov 24, 2015 at 6:41
  • @rohit, when m clicking on radio button, it is just showing that alert('success') and then unsuccessfull Commented Nov 24, 2015 at 6:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.