use ajax to fetch data from java hashtable in jsp page
-
I'm working on a project that the web page will fetch the data from java hashtable object in jsp page. I'm using a jsp for gerenated the web page based on HTML. The data is stored in the java hasbtable object on the server. I want to try to make an AJAX call to fetch the data from the server, then display it in the jsp page. I just want to know if this is possible to do that by make an AJAX call to access the java hashtable object, then fetch the data back to the client side. Thanks Here is the test.jsp page which contain the hashtable obejcts: Hashtable generalTable = (Hashtable) metaDataTable.get("General"); Hashtable adminTable = (Hashtable) metaDataTable.get("Administration"); My inital approach is to make an AJAX call to this test.jsp page. Then try to access those two GeneralTable and adminTable hashtable objects. In those two obejcts, it contains the values I would like to fetch. Unfortunately, I don't have the code yet for my part because I don't know if this is possible or not.
-
Answer:
Yes, it's possible, but you will need to have some server-side code to deal wit the request for the data you want, just like with any other AJAX functionality in any other system. One way to do this would be to have a "special" jsp that gives you back the data you need without any of the typical HTML. Having the special jsp output it's data as a JSON object will make your life much easier in the client-side code.
R.Spark at Stack Overflow Visit the source
Related Q & A:
- How can I use real time social data from Datasift and perform real time analytics on it?Best solution by Quora
- How to use ajax with autocomplete in jquery?Best solution by Stack Overflow
- how to use ajax with json in ruby on rails?Best solution by Stack Overflow
- How to link websiteurl in anchor tag in jsp page?Best solution by Stack Overflow
- Can I use ajax to call c#?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.