I am not cent percent sure if a lot of the wordings used in this post is going to be correct since I'm new to json and the web.
My purpose is to use json data from a server and parse it and show meaningful data to the user. I am aware of json parsing, so no sweat there. However, I would like to know how json data is sent to the front end after which it can be parsed.
Usually in my json parsing examples, I have a variable like var data = ]OR I do a getJSON on a data.json file which I have stored in the project folder. However, I want this data to come real time from a servlet. Can you guide me on how to go about this?
So, basically my question is, how do I send real time json data from a servlet backend, say some records which I have extracted from the database using jdbc?
My first advice would be not to use a servlet to send the JSON, but a REST web service using a library like Jersey. That's really how you implement WS these days, and it makes it real easy to create JSON from Java objects. Start reading here: https://jersey.java.net/