954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Thirusha
Posting Whiz
357 posts since Mar 2008
Reputation Points: 36
Solved Threads: 57
 

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

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

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.

Thirusha
Posting Whiz
357 posts since Mar 2008
Reputation Points: 36
Solved Threads: 57
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You