Bear Bibeault wrote:Not only is it not clear what is not working, your code seems to make not much sense.
You have a Java method that goes through a lot of steps, and then just returns the hard-coded variable "areaName". What's the purpose of all that?
Then in the code, you try to reference a scoped variable named "arrayList" (surely you can come up with a more descriptive name?) but nowhere in the code you posted does it show how that scoped variable gets set. Then in the loop, you create an iterator named theater that you don't use, but you reference another scoped variable named areaName that has never been declared.
It's not clear at all what you are trying to accomplish in the first place.
P.S. You also do not seem to be closing your database resources!
suraj savaratkar wrote:
Bear Bibeault wrote:Not only is it not clear what is not working, your code seems to make not much sense.
You have a Java method that goes through a lot of steps, and then just returns the hard-coded variable "areaName". What's the purpose of all that?
Then in the code, you try to reference a scoped variable named "arrayList" (surely you can come up with a more descriptive name?) but nowhere in the code you posted does it show how that scoped variable gets set. Then in the loop, you create an iterator named theater that you don't use, but you reference another scoped variable named areaName that has never been declared.
It's not clear at all what you are trying to accomplish in the first place.
P.S. You also do not seem to be closing your database resources!
You are right;
but here is complete java code;
suraj savaratkar wrote:
suraj savaratkar wrote:
Bear Bibeault wrote:Not only is it not clear what is not working, your code seems to make not much sense.
You have a Java method that goes through a lot of steps, and then just returns the hard-coded variable "areaName". What's the purpose of all that?
Then in the code, you try to reference a scoped variable named "arrayList" (surely you can come up with a more descriptive name?) but nowhere in the code you posted does it show how that scoped variable gets set. Then in the loop, you create an iterator named theater that you don't use, but you reference another scoped variable named areaName that has never been declared.
It's not clear at all what you are trying to accomplish in the first place.
P.S. You also do not seem to be closing your database resources!
You are right;
but here is complete java code;
I am trying to get the value from database and put into the arraylist and iterate in jsp page..
how to iterate that arraylist in the jsp page..
<div class="select-option"> <select id="selectedArea" onchange="getChanged(this);"> <option>--- Select Area ---</option> <c:forEach var="theater" items="${arrayList}"> <option> <c:out value="${areaname}"></c:out> </option> </c:forEach> <% int hour,second,min; Date date = new Date(); String todate = date.toString(); hour = date.getHours(); second = date.getSeconds(); min = date.getMinutes(); String time = hour + " : " + min + " : "+second; %> </select> </div> | <div style="font-family: Lucida Handwriting, Segoe Script, Snap ITC;" align="right"> <span id="date_time"></span> <script type="text/javascript">window.onload = date_time('date_time');</script> </div> |
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|