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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:24:02+00:00 2026-05-26T00:24:02+00:00

I have a JSP page which has nothing but a normal HTML table with

  • 0

I have a JSP page which has nothing but a normal HTML table with five rows and five columns.

Now I am making an Ajax call and get a response back. Now once I have the response back, I need the data to be filled in appropriate cells of the table.

So my question is;

  1. Should I use JSON for building the response?
  2. How do I handle the data back at the JSP level. That is, once I have the response from the server?

Just as additional information, I am using DWR which is nothing but calling a Java method (which builds the response) from inside JavaScript code.

  • 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-26T00:24:03+00:00Added an answer on May 26, 2026 at 12:24 am

    Let’s consider this Java class.

        class Employee
        {
            int id;
            String eName;
            // Setters and getters
        }
    

    In JavaScript, the JSON object:

     var employee = {
         id   : null,
         name : null
     };
    

    This is the call to a Java method from a JavaScript function:

       EmployeeUtil.getRow(employee,dwrData);
    

    In getRow() of the EmployeeUtil class, the return type of method will be Employee:

       Employee getRow();
    

    So using the setters of Employee set the data. dwrData is the callback function.

    function dwrData(data) {
        employee=data;
    }
    

    The data returned, which is an Employee bean, will be in the callback function.

    Just initialize this in the JavaScript JSON object.

    Use a JSON object accordingly to populate the table.

    EDIT :

    You can use List getRow() instead of Employee getRow(), returning a list of rows as a List instead of a Bean.

    Now the response contains list as data.

    Refer to Populate rows using DWR.

    Check these examples to populate data in table:

    • DWR + Dojo Demo
    • Dynamically Editing a Table

    Should I use JSON for building the response?

    • No need to pass JSON in response. Instead return a Bean of a class as mentioned above.

    • A list can be passed as a response, also as mentioned above.

    How do I handle the data back at the JSP level. That is, once I have the response from the server.

    Check the explanation above and the examples of the given links to handle the response in JSP and display the response data in a table.

    • DWR basics on YouTube
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSP page where I load an arraylist which has the list
Here is a problem I have encountered. I have jsp page which has a
I have a page in JSP, which has a tag like: <img src=images/1.bmp></img> The
I have a JSP page with a vector object which has about 10000 words.
I have a JSP page (home page) in a Web App, which has different
I have a JSP page which display a list from servlet, it has a
So I have a main JSP index page, index.jsp, which has several includes. Something
I have a list of records which has about 300 rows on a jsp
I have a jsp page which has different IF conditions.On load of the jsp
I have a jsp page which shows the contents of a table. While the

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.