I am new to Java EE programming. Following my understanding on jsp. Corret me if I am wrong
– JSP pages are converted to servlet first then to html and resulted html page is displayed in browser.
Now suppose jsp page is displayed in browser i.e now it is html page and I have a java List which have names or some sort of data that I want to print on the currently loaded page. I can get the List object using ajax but the how will I display it on html as html cant render java collections.
Correct me wherever I misunderstood the flow or basic concepts.
Thanks.
You could use ajax (using jQuery would be easy) to make a call to your Servlet
Now on Servlet, in
doPost(), Use Gson to generate JSON representation for your collectionNow we have response in javascript function as a array of javascript objects, So modify it to
Also See