DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JSP (http://www.daniweb.com/forums/forum24.html)
-   -   json loop in a jsp page (http://www.daniweb.com/forums/thread118174.html)

Thirusha Apr 9th, 2008 2:39 am
json loop in a jsp page
 
Hi

I have passed my json string to a jsp page, i would like to loop through this string to create a sql statement. Any ideas how i would go about looping through the json string in the jsp page?

a snipet of thejson string looks like this:
{"CREATEDBYNAME":"TEST_ADMIN","NAME":"test001","TYPEID":"1900000000"}

Any help will be appreciated.

Thanx
T

jwenting Apr 9th, 2008 12:32 pm
Re: json loop in a jsp page
 
not. That's not what JSP are to be used for.

~s.o.s~ Apr 9th, 2008 1:49 pm
Re: json loop in a jsp page
 
Like it has been already mentioned, use JSP's only for presenting data and not running your database code or parsing a JSON string; use servlets instead. And as far as parsing JSON using Java is concerned, there are a lot of JSON/Java bindings out there.

Thirusha Apr 11th, 2008 8:44 am
Re: json loop in a jsp page
 
thanx for teh replies. I have moved my loop into a servlet and it is working great. I have another problem though, but it has to to with servlets(at least i think so), so i m going to put my question there.


All times are GMT -4. The time now is 10:58 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC