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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:26:26+00:00 2026-05-25T06:26:26+00:00

Can I submit a request through jquery using $.get and use the returned result

  • 0

Can I submit a request through jquery using $.get and use the returned result as it returns from normal submition to server,

here’s what I mean, I want to make page navigator for all users in the system, I want to show 10 users per page, for the first time I request the page, the servlet returns 10 users and I show then like this

 <c:forEach items="${requestScope.AllUsers}" var="user" varStatus="loop">
        <tr class="userRow">
            <td class="numberWidth">${loop.index + 1}</td>
            <td class="nameWidth user" id="${user.userno}">${user.fullName}</td>
            <td>
                <c:choose>
                    <c:when test="${user.active == true}">
                        <button name="DeactivateBtn"  id="deactivate" class="deactivate btn">تعطيل</button>
                    </c:when>
                    <c:when test="${user.active == false}">
                        <button name="ActivateBtn" id="activate" class="activate btn">تفعيل</button>
                    </c:when>
                </c:choose>
            </td>
        </tr>
    </c:forEach>

when user click on the next page button, I sent request to servlet through jQuery

var param = {
    "page": "ViewUsers",
    "from": page_index * items_per_page,
    "to": (page_index * items_per_page) + items_per_page
};
$.get("InstitutionManagementServlet",param);

and it calls the same method that returns different users depending on the range I sent, the problem is that, for second request to servlet the users are not appear as the first time, even in consol shows that the return list has users values?

Does that have a concern of sending request using jquery???

  • 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-25T06:26:27+00:00Added an answer on May 25, 2026 at 6:26 am

    Here,

    $.get("InstitutionManagementServlet",param);
    

    You are not handling the response of the request at all. A callback function is missing. So whatever the servlet is returning is totally ignored. You need to add a callback function to handle the response:

    $.get("InstitutionManagementServlet", param, function(response) {
        // Handle response here. E.g., insert retrieved data in the desired place.
    });
    

    See also:

    • jQuery.get() API documentation
    • How to use Servlets and Ajax?

    Update: so, you actually want to send a synchronous GET request using JavaScript (e.g. changing the current page location altogether)? You can use window.location for this.

    window.location = "InstitutionManagementServlet?" + $.param(param);
    

    See also:

    • window.location MDC documentation
    • jQuery.param() API documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In HTML, you can send data from one page to another using a GET
So i am using ajax request to submit a form through a link. However,
How can I submit jQuery form object (not ajax)? I try form.submit() and it
I'm wondering how can I submit a form via Ajax (using prototype framework) and
How can I remove focus from submit button? I don't know why it is
I am having C function. From the html page, through ajaxcall the request is
I have a form that I submit through ajax, and returns an updated chunk
I am submitting a delete request through an anchor tag link, and using :remote
When you get a doGet or doPost call in a servlet you can use
I'm using a Webphere server. I am performing a file upload through a servlet

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.