Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Create Dynamic JSON using Servlet

 
ramu yadiki
Greenhorn
Posts: 13
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm new for these technologies. if you don't mine can you put that code here. please
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are plenty of examples of how to use the ObjectMapper class online. Google is your friend.
 
ramu yadiki
Greenhorn
Posts: 13
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic