This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring MVC + JqPlot Chart Data Retreiving error - Chart not loaded

 
priyanka kulathilaka
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Spring Controller class looks like this



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



* Array should be



- But i got it like this




Grid class shows below

Here shows my MapTable Class



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





Line Chart X & Y Axis & Background also load now.but data Line not shown there
please assist
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is your error? Is there an error message?

The only thing I see different from what you expected in the List to what you have is just the Time is missing. Maybe the Date object you are using doesn't support time, or you have a DateTimeFormat object that is removing the time.

I personally have never used JqPlot, so I wouldn't be able to help you on that side of the code.

Mark
 
priyanka kulathilaka
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Spritzler wrote:So what is your error? Is there an error message?

The only thing I see different from what you expected in the List to what you have is just the Time is missing. Maybe the Date object you are using doesn't support time, or you have a DateTimeFormat object that is removing the time.

I personally have never used JqPlot, so I wouldn't be able to help you on that side of the code.

Mark


I have edited my question now
please check that again & assist for solve that issue
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, first a comment. In your controller you have a signature of

List showLineChart(Map<String, Object> map,
HttpServletRequest request, HttpServletResponse response)

Why are you passing in the request and response. You don't need to pass those arguments, especially since you never use them. Even if you did @RequestParam is better to have Spring go into the request for you. Anyway.

So to me looks like you are getting the data that you want back out of the Controller. I see no difference between

* Array should be
var line1=[['2008-09-30 4:00PM',4], ['2008-10-30 4:00PM',6.5], ['2008-11-30 4:00PM',5.7], ['2008-12-30 4:00PM',9]];


- But i got it 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]]

And you don't bother telling us what the difference would be, just expecting us to guess. Please tell us what is different there. Again the Time is the only difference and I commented on that before.

It sounds like your chart tool is the problem and that it seems to be on the client JavaScript side, so this might not even be the forum you need.

Please give us more detail.

Thanks

Mark
 
priyanka kulathilaka
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Spritzler wrote:OK, first a comment. In your controller you have a signature of

List showLineChart(Map<String, Object> map,
HttpServletRequest request, HttpServletResponse response)

Why are you passing in the request and response. You don't need to pass those arguments, especially since you never use them. Even if you did @RequestParam is better to have Spring go into the request for you. Anyway.

So to me looks like you are getting the data that you want back out of the Controller. I see no difference between

* Array should be
var line1=[['2008-09-30 4:00PM',4], ['2008-10-30 4:00PM',6.5], ['2008-11-30 4:00PM',5.7], ['2008-12-30 4:00PM',9]];


- But i got it 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]]

And you don't bother telling us what the difference would be, just expecting us to guess. Please tell us what is different there. Again the Time is the only difference and I commented on that before.

It sounds like your chart tool is the problem and that it seems to be on the client JavaScript side, so this might not even be the forum you need.

Please give us more detail.

Thanks

Mark


thanks dear Mark Spritzler
now its solved.for other's use i posted it in my blog also

springjquery.blogspot.com
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool. Glad you got it solved. Wish I could have been more help to get it solved quicker.

So what was the issue and the solution? I checked out your blog post and it was just all code no text explaining it.

Mark
 
priyanka kulathilaka
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Spritzler wrote:Cool. Glad you got it solved. Wish I could have been more help to get it solved quicker.

So what was the issue and the solution? I checked out your blog post and it was just all code no text explaining it.

Mark


here i'm going to return list by ResponseBody.but i solved it like this.
i return array object.

check contoller class in here & my blog
check the difference

thanks again for your feedback

:-)
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. so the chart wanted the data in a format that List was not giving you but Object[] did. Very interesting. I would think that they would return the same json with @ResponseBody. I wonder why it didn't

Thanks for posting.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic