Bear Bibeault wrote:Then I would say that learning how to use ASP more effectively is the right approach rather than changing the response structure to something less versatile.
I'm not sure there are many ASP experts here who can help you as these forums are not focused on Microsoft technologies.
But someone may chime in -- I've changed your subject to better attract the ASP-savvy.
Bear Bibeault wrote:Oh, that's different. I'll move this to the JSP forum and change the title again.
You'll want to show how the JSON is being used in the JSP.
Paul Clapham wrote:Then the best thing to do would be to NOT do it in a JSP, but to do it in a servlet, or some helper class. Write some Java code to generate a suitable data structure, then put that data structure into request scope and forward to a JSP. All that JSP needs to do is to transform the data structure to HTML, which should be simple.
Bear Bibeault wrote:Why would you want to change the format? The existing format is "more correct" and also allows for extending in the future. For example, what if you eventually need to add metadata to the construct?
Paul Clapham wrote:I don't think you're doing it the right way. You want the two records in your sample JSON code to be displayed in two separate rows of a table, so your Java code should be generating a data structure with two elements in it, each of which contains a row from the database in some way.
Bear Bibeault wrote:Why would this be done in Java code?