Spring MVC + JqPlot Chart Data Retreiving error - Chart not loaded
priyanka kulathilaka
Ranch Hand
Joined: Apr 13, 2011
Posts: 34
posted
0
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
Priyanka Kulathilaka
Software Engineer - Java
Sri Lanka
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 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
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
Joined: Apr 13, 2011
Posts: 34
posted
0
Mark Spritzler wrote:OK, first a comment. In your controller you have a signature of
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
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