This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to Create Dynamic JSON using Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to Create Dynamic JSON using Servlet" Watch "How to Create Dynamic JSON using Servlet" New topic
Author

How to Create Dynamic JSON using Servlet

ramu yadiki
Greenhorn

Joined: Jul 26, 2013
Posts: 13

hi friends i want to create one json file dynamically using servlets. in my data base i have emp table. so i want read that table through servlet and after that create that data into one json file. so can you tell me how to create that dynamic json. and finally store that json into one folder
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
If you read the data into a List<Pojo> then you can use json libraries like Jackson to do the conversion for you.
ramu yadiki
Greenhorn

Joined: Jul 26, 2013
Posts: 13

i'm new for these technologies. if you don't mine can you put that code here. please
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
There are plenty of examples of how to use the ObjectMapper class online. Google is your friend.
ramu yadiki
Greenhorn

Joined: Jul 26, 2013
Posts: 13

Actually i'm new for EXTJS,json using servlets. My problem is if i change any thing in database table so that related data will be automatically displyaing in EXTJS charts. this thing i want. when ever table is updated that related data in charts also i want update.
 
 
subject: How to Create Dynamic JSON using Servlet