Hi

I am working with java project, using jsp, struts 2.1 and servlet technology.
I would like to create a json file or a object from the data from the database using sql query on fly. Then pass this data to jsp page dynamically.

Please can someone help or put me on a right track.
I would appreciate an example.

many thank

Use the Java binding for JSON. Its pretty simple and after your JSON object has been constructed, all you have to do is store the representation in a String variable which can be accessed by your JSP; i.e. the normal way in which you pass data to and fro from you JSP.

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.