I have a JSP page, in which there is a link. When i click on the link, it will execute an ajax script and in turn the script will pass the request to a struts action class. The action class will perform some DB queries.
My question is that,
Can the action class have ArrayList as the return type?
I do not want to create a html (db result may vary in size from 10 rows to 100+ rows) in the action class and pass it as a string to the caller. I want to use the iterator in JSP page.
Once a JSP is sent to the browser, it is no longer a JSP -- it's a simple HTML page like any other. So there is no way for an Ajax request (or anything else) to return a Java construct that the JSP page can operate upon.
An Ajax request returns a response like any other request. It can be an XML document, an HTML fragment, a JSON construct, or any other text value. But it is a text value.