to read data stored in ArrayList

to read data stored in ArrayList

this is regarding struts2, i have create one ArrayList object and in that i have stored 4 User class objects taking them from database. Now i want to read the data of all 4 User objects from jsp file using struts2 tag. i have done the following thing, but i am getting data only of one User.
<s:iterator value="userList" status="itstatus">
<li>
<s:push value="userList[0]">
<s:property value="userList[1].username"/>&nbsp;&nbsp;
<s:property value="userList[1].password"/>&nbsp;&nbsp;
<s:property value="userList[1].type"/>
</s:push>
<br>
</li>
</s:iterator>

My problem is i have to use index variable, but i am not getting how to use it. if you know this , please send me the answer. i well be very grateful to u.
View Answers

May 4, 2010 at 4:26 PM

Hi Friend,

Please visit the following link:

http://www.roseindia.net/struts/struts2/struts2controltags/iterator-tag.shtml

Hope that it will be helpful for you.
Thanks









Related Tutorials/Questions & Answers:
to read data stored in ArrayList - Struts
to read data stored in ArrayList  this is regarding struts2, i have create one ArrayList object and in that i have stored 4 User class objects taking them from database. Now i want to read the data of all 4 User objects from jsp
Retriving data stored in database
Retriving data stored in database  Hi, How to retrive data from my sql database using Hibernate,Spring and tapestry please give me an example.I am new to this Hibernate and Spring
Advertisements
where are program instructions and data values stored
where are program instructions and data values stored  Where are program instructions and data values stored in Computer?   In Storage. Actually, whichever program and data we use in our computers are stored in Storage
Managing Multiple User Input Data in an Array (or ArrayList)
Managing Multiple User Input Data in an Array (or ArrayList)  Hey... record alphabetically (2) If user chooses choice1, the input data is stored in an ARRAY (or ARRAYLIST) until the user chooses to stop inputting data. Kindly
Data read. - XML
Data read.  How to store or read data in XML from Struts.Plz give me example. Thanx
Read RFID data
Read RFID data  how to read RFID data using java
ADT ,data structure (ArrayList), sorting
ADT ,data structure (ArrayList), sorting  Write a program to calculate a bonus for 10 employees of WAFA Supermarket. The program consists... in different arrayList depending on his/her position (cashier or supervisor
READ DATA - Java Beginners
READ DATA  i still don't understand, i have a data like...; Data in the up is my problem how to get this and save into database and ; must dissapear.then data go to values in database. d00002 go to kd_div,Marketing go
when refreshing the page the data is stored in data base again
when refreshing the page the data is stored in data base again  Hi, In my application, I am adding form data in database on click of submit button.But the problem is, when user refreshes the page, the data added one more time
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
Insert Data in Table Using Stored Procedure
Insert Data in Table Using Stored Procedure ... data into a table using stored procedure. Steps: 1.Create database... is the video tutorial of Creating and calling the Stored Procedure in MySQL Database
Read data again - Java Beginners
Read data again  Hey, i want to ask again about how to read data...), jab varchar(35), cab varchar(15), ket varchar(30) My data in txt file is://i want this read to DB d00001;Operation;Finance;Finance Head;Kantor Pusat
read text file and store the data in mysql - JDBC
read text file and store the data in mysql  when we store the data in mysql table from text file its store the data from new line to new column. how to store the data in different column from a single line of text file. 
arraylist of an arraylist
arraylist of an arraylist  Can anyone suggest me how to use arraylist of an arraylist?? how to put data into it and get data from it???? becoz i want to make rows and column dynamic which can grow as per requirement?????/ plz
Read data again - Java Beginners
Read data again  sir, i still hav a problem,first your code will be change like this : in netbeans out message error 5. Can you help me again. My... = DriverManager.getConnection("jdbc:odbc:hyt","root","suprax"); //Read File Line By Line
Read data again - Java Beginners
Read data again  OK my problem some like my first question.First i... varchar(15), cab varchar(15), ket varchar(30) then i have a data from txt file... Pusat; i want data from txt file save to database like my DB with one button.but
JSP data after login where different users data are stored in database
JSP data after login where different users data are stored in database ... and then after they can login. my question is how a user can see only his data after login where different users data are stored in database,plz...provide me answer its
arraylist
arraylist  Hi how can we eliminet duplicate element from arraylist in java? how can we achieve data abstrcation and encapulation in java? how many type of modifier are there in java? Thanks kalins anik   Remove
the last data entered into database is getting stored again after refreshing
the last data entered into database is getting stored again after refreshing  hey all i made a shout box using php and mysql but the last data... if the data is deleted from the database the last data entered is getting posted plz help
arraylist
arraylist  Hi How can we eliminet duplicate element from arraylist? How can we find highest salary from arraylist ? How can we highest key value pair from map? Thanks Kalins Naik   Remove duplicates from Arraylist
arraylist
arraylist   Using arraylist class , what type of exception are throws, how can write a java programe   An ArrayList can throw... ArraylistException { void buildAlphabet() { ArrayList list = new ArrayList
arraylist
data into an arraylist and display the data of the particular employee according...arraylist  Hi i have class A , i have added employee name and id in arraylist, then how can i find out all infomation of class A using emplyee
ArrayList
ArrayList  import java.util.*; class ArrayListDemo2 { public static void main(String args[]) { ArrayList al=new ArrayList(); al.add("one"); al.add("two"); al.add("three"); al.add("four"); for(int i=0;i Expected
how insert data from databse in array and compare new data to already stored value in array
how insert data from databse in array and compare new data to already stored value in array   hello all i tried to fetch data from databse and try to stored it in an array and i want to compare new value that come from database
callable statement,stored procedure for insert data and also for update data into oracle database using jsp
callable statement,stored procedure for insert data and also for update data... have one task to do soft parsing tl asked to do callable statement,stored procedure for inserting data into oracle database as bind variable and same
Stored Data in XML File using Servlet
Stored Data in XML File using Servlet  ... to stored data in xml file using Servlet  We have created  file login.jsp,XmlServlet.java. User details in the "login.jsp" are to be stored
How Can I get ArrayList of Data from jsp with ajax request
How Can I get ArrayList of Data from jsp with ajax request  Hi, I retereved 5 Employee Record of Data from Struts Action class to jsp with ajax response. But I don't how how can reterve this dynamic 5 employee records
arraylist
% *(noOfYearService/2). Store each employee information in different arrayList depending on his
read excel data from jsp - JSP-Servlet
read excel data from jsp  Hi how to read excel file from jsp? Excel file is created manually entered data having many sheets? and read the entire...)excel.jsp: Read And Edit Excel File  continue
a little problem in read data - Java Beginners
a little problem in read data  ok Vinod Kumar and friend, i already use this code. but is data null, this code will error5 again. How the data can go to database with null data. ex: value = (d00001;Operation;Finance;Finance Head
automatically move next page when data fetched from database is stored in text field
automatically move next page when data fetched from database is stored in text... are stored in database wherein when the in the first text field the data is already stored when data in second text is tried to enter or automaticaaly fetched
Fastest way to upload huge raw data in database - c#, Java or stored procedure
Fastest way to upload huge raw data in database - c#, Java or stored procedure  I have huge raw data that needs to uploaded in database... this data - Stored procedures, Java or c#. Why? What are the advantages
Read data from Excel and insert in to DB and export data from DB to Excel
Read data from Excel and insert in to DB and export data from DB to Excel  Read data from Excel and insert in to DB and export data from DB to Excel Hi, I need to read the data from excel and I need to insert the same in to DB
ArrayList object
ArrayList object  i have am ArrayList object it containg data base records in it, now i want to display this ArrayList object data in my jsp programe, plz help me
arraylist not able to store large amount of data( over 1 lakh records) - Java Interview Questions
arraylist not able to store large amount of data( over 1 lakh records) ... function that iterator is used to iterate and data from above arraylist is used... and also though the feature of arraylist is to expand itself with extra incoming data
Read Excel data using JSP and update MySQL databse
Read Excel data using JSP and update MySQL databse  HOw to read excel data using JSP and update MySQl database
How to read data dynamically from keyboard to array in flex
How to read data dynamically from keyboard to array in flex  How to read data dynamically from keyboard to array in flex
how read data from doc file in same formate in jsp
how read data from doc file in same formate in jsp  how we can read and display data on jsp page, from doc file with the same formatting
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp  read data... for scientific research analysis. My team members sends research data in excel file format and I need to update MySQL tables with new experimental data. How can I
stored procedure
stored procedure  what is stored procedure
stored procedures
stored procedures  What are stored procedures
stored procedures
stored procedures  What are stored procedures
how to pass arraylist data from one jsp to another jsp - JSP-Servlet
how to pass arraylist data from one jsp to another jsp  hi to all iam not able to pass the data which is stroed in arraylist, actually i need to receive all employee id's that are retrived from the database in the first jsp
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.  The code for retrieving data from database into Drop Down List. <% DataSource data = new
comparing arraylist of an multi dimensional arraylist
araylist.if we find the content of the two arraylist similar then it shuld be stored...comparing arraylist of an multi dimensional arraylist  can anyone help me in solving the following issue: actually i have an arraylist called dany
Read specific column data from text file in java
Read specific column data from text file in java  My question is if my text file contain 15 columns and i want read specific column data from that text file then what code i should do
How to read excel data and store it in database - Java Beginners
How to read excel data and store it in database  Hi, I want a java code to read data from excel and store it in Ms Access database.I tried the code... read data into database.So please give me some sample code. Thanks
How to read the data in text file seperated by by ',' in java using IO Operations
How to read the data in text file seperated by by ',' in java using IO Operations  in Text file data like raju 45,56,67 ramu 46,65,78 raji 34,23,56 this is the student marks in text file.this data read and calculate
How to read and display data from a .properties file from a jsp page
How to read and display data from a .properties file from a jsp page ... the data from this .properties file and display it in table format. Ex:by using... = DEDCHGG_PWDP and goes on... I have to create a jsp page to show these data
how read excel data into database using struts2 with hibernate
how read excel data into database using struts2 with hibernate   hi friends, i am venkat i am started learning struts 2, please help me how to read excel data into database using struts2 with hibernate, please show me

Ads