aspose file tools*
The moose likes JSP and the fly likes Parsing an JSONArray on to JSP Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Parsing an JSONArray on to JSP Page" Watch "Parsing an JSONArray on to JSP Page" New topic
Author

Parsing an JSONArray on to JSP Page

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


Hi ,

Please tell me this : How can i parse an JSONArray Object

List mybeanList = new ArrayList();
mybeanList.add("S");
mybeanList.add("b");

JSONArray jsonA = JSONArray.fromObject(mybeanList);



Thanks in advance .


Save India From Corruption - Anna Hazare.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Waiting for answer .
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18133
    
  39



I have never used this class myself, but a quick google... it says that the JSON is generated via the toString() method. Doesn't that mean that you should call the method when generating your javascript -- maybe in an assigment, so your javascript can use the result that was calculated by the JSP?

Or are you referring to a different type of parsing here?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

Ravi Pavan wrote:Waiting for answer .
Please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing an JSONArray on to JSP Page
 
Similar Threads
Populate Collection of beans from Struts 2 form submission (jdk 1.4)
JSON Syntax error
select query , Need to store objects in a JSONArray
JSONArray parse error
how to convert java ArrayList into JSON format data?