Hi,
We are facing an issue as shown below.(Sorry for posting struts query here)
-----------------------------------------------------------------------------------
In jsp page ::
<logic:iterate id="countryNameDet" name="form" property="countryNameDet">
<tr>
<td align="left" colspan="3">
<bean:write name="countryName" property="country_Name" />
</tr>
</logic:iterate>
-------------------------------------------------------------------------------
Java code as shown below ::
List countryNameDET = new ArrayList();
countryNameDET = CountryDAO.getCountryDetails(); //access db and retrieve country Details as a list
form.setCountryNameDet(countryNameDET); //countryNameDET is the list set in the form
StringTokenizer st = null;
CountryPOJO country = null;
Iterator iterator = countryNameDET.iterator();
String[] countries = new String[3];
while (iterator.hasNext()) {
country = (CountryPOJO) iterator.next();
int counter=0;
SOP(country.getCountry_Name()); //we get period sepearated Countries (Example : London.Mumbai.Calcutta.Bangalore.Brisbane)
st = new StringTokenizer(country.getCountry_Name(), "."); //stringTokenizer to Tokenize Countries and retrieve individual countries
while (st.hasMoreTokens()) {
countries[counter] = new String(st.nextToken());
System.out.println("Country is -->"+countries[counter]) // display individual countries
counter= counter+1;
}
}
//how do i need to set the String Array here and access in jsp (in Struts)---> Please need help forum members..
//how do i neeed to write the logic iterate tag for Displaying individual countries one below the other in jsp ???
When I tokenize the Strings I get 3 independent strings.which I need to display in the jsp page using logic:iterate one below the other how do I do that
In jsp output should be
London
Mumbai
Calcutta
Bangalore
Could you please help me with the code in JSP and how to set the countries in Java.(Action class)...
I will be highly obliged if you could please help me out !!
Edited by: Deepak_A_L on Oct 27, 2009 10:30 PM