Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6047905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:24:14+00:00 2026-05-23T07:24:14+00:00

I am having problem with my jQuery function what I am trying to achieve

  • 0

I am having problem with my jQuery function what I am trying to achieve is to populate data in a listbox

The JavaScript function

function load() {
        $.getJSON('${findAdminGroupsURL}', {
            ajax : 'true'
        }, function(data) {
            var html = '<option value="">Groups</option>';
            var len = data.length;
            for ( var i = 0; i < len; i++) {
                html += '<option value="' + data[i].name + '">' + data[i].name
                        + '</option>';
            }
            html += '</option>';

            $('#selection').html(html);
        });
    }

The server side is

@RequestMapping(value = "groups", method = RequestMethod.GET)
    public @ResponseBody
    List<Group> getGroups() {
        return this.businessGroups();
    }

I call load() function on load it triggers the function getGroups() and returns the list successfully but the problem is once the getGroups() is finished

function(data) doesn’t load never gets into that function and the error is

org.springframework.web.HttpMediaTypeNotAcceptableException:
Could not find acceptable
representation

Can’t I post back a list of Group objects, or does it have to be a Java primitive type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:24:14+00:00Added an answer on May 23, 2026 at 7:24 am

    A similar post I found today ..

    Spring's Json not being resolved with appropriate response

    Hope this might help

    http://forum.springsource.org/showthread.php?85034-HttpMediaTypeNotAcceptableException-(always)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a little problem. I'm trying to use Jquery load() function to load
I am having a problem trying to use the prependTo() function in jQuery... for
I'm having a problem with jquery trim function. I'm trying to convert an html
I'm having problem with Jquery on Drupal. Here is what I'm trying to achieve,
I am having problem getting my tooltip to work when using the jQuery load()
I'm having a problem trying to format the output on the jQuery UI datepicker.
I’m having a problem trying to detect if a table exists using jQuery. The
I'm having a problem trying to return a specific record using jQuery and JSON.
How it works: I'm trying to create an instant upload function with Jquery/Ajax. When
I'm a designer trying to learn Jquery and I'm having a problem with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.