Hello,
I was asked this questions in an interview.
Which is one is best. Javascript looping to iterate through collection or use JSTL/any framework provided/for/while loops to loop through the collection to display information onto the browser.
At that point of fact I could not answer to that properly.
I was thinking in terms of code size of the
JSP because of its 64K limitation and Client browser setting when Javascript looping is used.
Thinking more and more of it, I feel Using JSP looping is better than Javascript.
Person who interviewed me says that the javascript code is much simpler to maintain and on time scale it is more faster than using
java looping.
But I think using Java looping makes code simple and easer to maintain. May be first page will take time to load but subsequent page will be loaded faster.
It is not that I don't want to use javascript at all. I want to use it where I want to populate select option on selection of other form field or something like that.
I was wondering if I am missing something.
Please share your thoughts.
Thank you