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

  • Home
  • SEARCH
  • 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 8733669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:41:55+00:00 2026-06-13T09:41:55+00:00

My Spring Controller class looks like this @SuppressWarnings(rawtypes) @RequestMapping(value = /cityGridView, method = RequestMethod.GET)

  • 0

My Spring Controller class looks like this

@SuppressWarnings("rawtypes")
    @RequestMapping(value = "/cityGridView", method = RequestMethod.GET)
    public @ResponseBody
    List showLineChart(Map<String, Object> map,
            HttpServletRequest request, HttpServletResponse response) {
        List<Object> rows = new ArrayList<Object>();
        List<MapTable> list = contactService.fin();
        for (MapTable table : list) {
            List<Object> dataRow = new ArrayList<Object>(1);
            dataRow.add(table.getSRDate());
            dataRow.add(table.getNumberOfSR());
            rows.add(dataRow);
        }
        return rows;
    }      

In my jsp i handle response like this. (seems issue in here ??)

<div id="chart1" style="width: 800px;height: 500px" ></div>
    <script type="text/javascript">
    $(document).ready(function(){
          var ajaxDataRenderer = function(url, plot, options) {
            var ret = null;
            $.ajax({
              async: false,
              url: url,
              dataType:"json",
              success: function(data) {
                ret = data;
              }
            });
            return ret;         
          };

    var jsonurl = 'cityGridView.html';

    var today = new Date(); 

    var plot1 = $.jqplot('chart1', jsonurl, {
          title:'Data Point Highlighting',
          dataRenderer: ajaxDataRenderer,
          dataRendererOptions: {
              unusedOptionalUrl: jsonurl
              },
          axes:{
            xaxis:{
                label: "SR_DATES",
                'numberTicks' : 7,
                min: '2012-10-01',
                max: '2012-10-07',
                renderer:$.jqplot.DateAxisRenderer,
                rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer},
                tickInterval:'1 day', 
                tickOptions:{
                    formatString:'%Y-%#m-%#d'
                    }
            },
            yaxis:{
                label: "SR COUNT",
                tickOptions:{
                    formatString:'%d'
                    },
                min:10,
                max:30
            }
          },
          highlighter: {
            show: true,
            sizeAdjust: 7.5
          },
          cursor: {
            show: true
          }
      });
    });

    </script>
  • My JSON like this

    [[“2012-10-01”,15.0],[“2012-10-02”,20.0],[“2012-10-03”,25.0],[“2012-10-04”,18.0],[“2012-10-05”,22.0],[“2012-10-06”,24.0]]

Here shows my MapTable Class

public class MapTable {

    private Date SRDate;
    private int numberOfSR;

    public Date getSRDate() {
        return SRDate;
    }

    public void setSRDate(Date sRDate) {
        SRDate = sRDate;
    }

    public int getNumberOfSR() {
        return numberOfSR;
    }

    public void setNumberOfSR(int numberOfSR) {
        this.numberOfSR = numberOfSR;
    }
}

contactService.fin(); Method called to Service Classes & finally it in DAO classes.
Data also correctly come like above i mentioned array.here is my DAO class

public List<MapTable> fin(){
        @SuppressWarnings("unchecked")
        List<MapTable> dashboardBeanList = jdbcTemplate
                    .query("select trunc(ASSIGNED_datetime) as SR_DATE, count(*) as COUNT " +
                            "from sbl_service_request_v " +
                            "where SR_TYPE ='Complaint' " +
                            "and DATE_COMMITED  is not null " +
                            "and ASSIGNED_DIVISION  in ('CSO','IT_IVR') " +
                            "and trunc(ASSIGNED_datetime) >= sysdate -30 " +
                            "group by  trunc(ASSIGNED_datetime) " +
                            "order by trunc(ASSIGNED_datetime)",
                                            new Object[] {},
                                new RowMapper() {
                                      public MapTable mapRow(ResultSet rs, int rowNum)
                                                  throws SQLException {
                                          MapTable dashboardBean=new MapTable();
                                          dashboardBean.setSRDate(rs.getDate("SR_DATE"));
                                          dashboardBean.setNumberOfSR(rs.getInt("COUNT"));
                                          return dashboardBean;
                                      }
                                });
        return dashboardBeanList;
    }
  • 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-13T09:41:56+00:00Added an answer on June 13, 2026 at 9:41 am

    Your expected vs actual JSON data are different in a couple of ways and you have not stated which differences matter. But I’ll tackle the "rows": bit first as it represents a JSON structural difference (as opposed to data value differences).

    Your actual JSON output contains the "rows": property because you have returned a Grid object from your controller – which had a field called rows populated with your list of lists. If you simply want your JSON to contain the list of lists, then return that from your controller: return rows.

    Your date format is also different, so I would look at the getter method for your MapTable .getSRDate() as a first step – there is not enough info/code in your question to address this directly.

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

Sidebar

Related Questions

I'm using Spring MVC and jquery autocomplete, my spring controller looks like this @RequestMapping(value
I have a basic Spring MVC controller that looks like this: @Controller public void
My controller looks like this: public class PortefeuilleController : Controller { public ActionResult Create()
I have @Controller @RequestMapping(value=core/*) public class CoreController { public static String exceptionOccurredView = /core/exceptionOccurred;
Ok, I have a ViewModel that looks like this: public class UserLogin { [Required]
I have a Security class that looks like this: package controllers; import play.Logger; public
earlier I use Spring MVC and annotation @ModelAttribute. @Controller public class ArticleController { @ModelAttribute(articles)
I have the following controller mapped as @Controller( value = stockToStoreController ) @RequestMapping(/stsr) public
I find @RequestMapping is very usable in the controller class. This annotation based controller
If I have a Spring Controller with two SEPARATE methods, one annotated by: @ExceptionHandler(Exception.class)

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.