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 8554365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:51:58+00:00 2026-06-11T14:51:58+00:00

I have a jQuery web app frontend that I would like to make GET/POST

  • 0

I have a jQuery web app frontend that I would like to make GET/POST ajax calls to a Java backend that is running on Spring MVC.

Here is the GET request I want to make:

http://www.myapp.com/backend/doSomething?a=1&b=2

On the server-side, here is my BackendController object:

@RequestMapping(value = "/backend/doSomething", method = RequestMethod.GET)
public ModelAndView handleDoSomething(@RequestParam("a") String a,
    @RequestParam("b") String b) {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("backend/SomeView");

    // process the request...

    return mav;
}

So here’s the jQuery I have attempted so far:

$.get({
    url: "/backend/doSomething?a=???&b=???",
    success: function(data) {
    }
    ???
});

I’ve read the jQuery $.get page and I’m still confused about several things:

  1. What’s the proper way of appending query string parameters into the url for GETs?
  2. What’s the proper way of adding form data into POSTs?
  3. I see that the success function takes three params: data, textStatus, and jqXHR, but many examples I see only list the data portion – when do you pass it just data and when do you pass it all three?
  4. What’s the difference between the get‘s data property and its success: function (data) { ... } argument?
  5. Is there any special configuration I need to do in my Spring backend so that jQuery can connect to it, or does jQuery not care about the backend at all?

I’ve tried looking these up but can’t seem to get clear definitions for these items. Thanks in advance.

  • 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-06-11T14:51:59+00:00Added an answer on June 11, 2026 at 2:51 pm

    jQuery Get/Post Params

    1. Url
    2. Data – the data object which is where you would store the query string like data (ie post variables)
    3. Success Handler (the extra params are not required which would be why you have seen it in different formats)
    4. DataType – the data type expected back from the server

    FYI, I believe the url param is the only required param. Your get call should look something along these lines:

    $.get("/backend/doSomething", { a : a, b : b }, success: function(data) {
        // Perform Success code
    });
    

    By the way, you can also serialize a form to pass it through your post using something like:

    $('form').serialize()
    

    Edit:

    Regarding naming the url, data, and success params when using jQuery $.get() and $.post(), this is not possible. These functions are shorthand versions of jQuery $.ajax(). There is no point in using get/post if you are going to what to do the long form anyways. If you want to specify the params then use ajax like so:

    $.ajax({
        url: "/backend/doSomething", 
        data: { a : a, b : b }, 
        success: function(data) {
            // Perform Success code
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app. that uses AJAX (via jQuery). I noticed that some
I have a php / mysql / jquery web app that makes 13 ajax
I have a web app that I've recently applied a jQuery ThemeRoller theme to.
I have a web page that uses jquery ajax to grab the table markup
I have a web app (JSPs and Servlets along with jQuery) that I am
I'm using javascript and jQuery. I have a problem that my web app has
I'm building a web app using jquery mobile that will have lots of images
I have a web app of which I would like to create a mobile
I have a jquery mobile web app. On my iPhone when I am on
I have a simple jQuery code that runs on a web page that has

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.