I have a question about rending data from server. My java Response class will store some data object in session, and load into combo box. Meanwhile, I have another set of data retrieved from server, and stored into session. My wish is to dynamically change the value in a table, so that it will vary according to the input by the combo box from the client side.
Here is my example:
1. Combo Box has some currency value, like AUD, CAD, EUR, etc 2. My session Stores a floating Rate option object(String pair), like AUD-BBR-BBSW, CAD-BA-CDOR. 3. If I choose AUD from combo box, then the table should render the innerHTML "AUD-BBR-BBSW"
However, I am not sure how to render this server side object from client side, is there any suggestions ?
This is very easy to do using Ajax, using--for example--the Prototype framework of Script.aculo.us.
In a nutshell, I would set up a servlet to return whatever data is required for the table, based upon the user's combo-box selection, then use Ajax.Updater (from script.aculo.us) to get the data from the servlet and populate the table when the combo-box's onchange event fired.
This would provide the user with a dynamic application.
(Obviously, Ajax has nothing to do with JSP, per se)
Note: it is not good to store data in the Session that you could retrieve from a data store easily, because it limits the scalability of your application. Too many users = server runs out of memory