0

Hi everyone, I have a question. I m using iterator to loop my jsp

such as code below in my jsp

<%Iterator itr;%>
              <% List data=(List)request.getAttribute("data");%>

I use servlet as my engine to proceed my sql statement.

below is my sql statement

select * from a natural left join b natural left join c natural left join d where dept='Marketing'

and then i use

List dataList = new ArrayList();

and add data from database into my datalist.

weird problem is everytime I post, it gives me blank page but before this I get data with first button.second button failed..may i know y?

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Stefan_Lam88
0

Is there really a need for iterator? You can loop through list as

List<PersonalData> personalDataList = new ArrayList<PersonalData>();
//list populated by "add" or directly from DB results
for(PersonalData personalData : personalDataList){
  personalData.getName();
  personalData.getAddress();
}

As why no data visible on page? Difficult to say since you posted only few lines...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.