<<<<<<<<<<< var notes = new Array();
here ur code is wrong ur creating a notes array here ...
after that u print that !!
so nothing will print ...
put ur resultset list in session or resquest u getting ur jsp
Main Topics
Browse All TopicsHi Experts,
I have an Arraylist which contains some text entries fed to it from the Database.
In my jsp page, I have javascript text slideshow which displays the content of this ArrayList.
My database table has 10 rows(10 messages), where as on my jsp page, every entry is duplicated 13 times. so all together 130 entries.
Where am I going wrong.
Below is the small piece of code from my JSP, where I loop over the ArrayList
<script type="text/javascript">
var count = 0;
var notes = new Array();
<c:forEach items="${notes}" var="current" varStatus="status">
notes[${status.count - 1}] = "${current}";
</c:forEach>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> Is this what I need to do??
What you need to do is use the code at the link i posted
http://technojeeves.com/jo
Well there's another view here:
http://technojeeves.com/jo
I would rather hope that a method called 'resultSetToNestedList' would be self-explanatory ;-) What don't you understand?
>>so we dont ever need a for loop to fill in values into an ArrayList?
Yes you do. You just happen not to need one in this case as you're only returning one column.
Arranging your code so it breaks if you want to change the query is not a 'simplification', it's just poor planning and if you get into the habit of making such decisions it will lead to code that is easily breakable and hard to maintain.
If you want to write code well you should be seeing the exercise as applying patterns wherever possible.
Using code that works irrespective of the query is the best course unless there are overwhelming reasons to write code that will effectively only work once
All that code does is add an extra level of indirection for no gain. You don't need it, what I posted above does all you need, and is lot clearer than something returning a table model when what you actually want a list of notes. Its simpler and clearer, win, win :)
> Arranging your code so it breaks if you want to change the query is not a 'simplification'
sorry, but that just doesn't make sense :)
Business Accounts
Answer for Membership
by: CEHJPosted on 2009-10-21 at 10:20:03ID: 25626116
You have nested loops. You need just one. See
omla/index .php/free/ 59-results et- to-tabl emodel
http://technojeeves.com/jo