I am writing a stock application. Related to this question, I want the user to be able to sell the stocks they have previously bought.
I'm getting the previously bought stocks from the db at the servelet in the form of an ArrayList:
ArrayList a= db.getUserStocks(userid);
request.setAttribute("userstocks", a);
System.out.println(a);
This prints to the console:
[{Stock=Asianpaint}, {Stock=Infy}, {Stock=Tatasteel}]
I want the user to be able to select one of the above stocks from, say, a drop down list or an autocomplete search box and get the current value/price for it at the click of a button. How do I accomplish this in a JSP file?
TL;DR: Just being able to print the ArrayList values in a JSP file should be a good enough headstart.