Hi,

i am working on real time data grid using Flexigrid (JSON and Jquery).When
the grid loads it show the list value.My question is how to return a json
array value in ModelAndView.I have put all the values in Map,once the page
loads it returning Raw jsp. It means it is not returning the array values.

my controller returns

if (resType.equalsIgnoreCase("JSON")) {
             if (CollectionUtils.isNotEmpty(list)) {   
                
                 lStringBuffer.append("{page:1,total:50,");
                 lStringBuffer.append("rows:");
                // lStringBuffer.append("[");   
                 boolean rc=false;
                 for(int i=0;i<list.size();i++){
                         Json json2=(Json)list.get(i);
                        
                         if(rc) lStringBuffer.append(",");
                     lStringBuffer.append("{");
                     lStringBuffer.append("id:'"+json2.getId()+"',");
                    
lStringBuffer.append("cell:['"+json2.getId()+"','"+json2.getName()+"','"+json2.getIso()+"','"+json2.getPrintable_name()+"','"+json2.getIso3()+"','"+json2.getNumcode()+"']");
                     lStringBuffer.append("}");
                     rc=true;
                 }
                 //lStringBuffer.append("]");   
                 lStringBuffer.append("}");   
                
               map.put("json",lStringBuffer.toString());
                }
return new ModelAndView("jsonView",map);
the json url loads the jsonView.html page as a data.

Please help me to resolve with Json
-- 
View this message in context: 
http://n4.nabble.com/How-to-return-Json-object-in-ModelAndView-tp964320p964320.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to