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

not. That's not what JSP are to be used for.

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.