Hi,
Sorry for the late response. All you need to do in the JSP is need to call the function dbConneciton(ResultSet rs); You can make that function much better this is just for Example.
In JSP page once you have the ArrayList you can display the String by using out.println() statement so that it will display you the Input values.
Hope this will help you.
import org.apache.struts.util.LabelValueBean;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
*
* User: venu reddy
* Date: Jan 8, 2004
* Time: 11:45:59 AM
* Java: ${filename}
*/
public class TekBean {
private static final int HIDDEN = 1;
private static final int TEXT = 2;
private static final int SELECT = 3;
private ArrayList arrayList = new ArrayList();
public TekBean() {
}
public void addToList(int type, String name, String value, List list) {
StringBuffer buffer = new StringBuffer();
if (type == HIDDEN)
{
buffer.append("<input type=\"hidden\" name=\"" + name + "\" value=\""+ value +"\">"

;
}else if(type == TEXT)
{
buffer.append("<input type=\"text\" name=\"" + name + "\" value=\""+ value +"\">"

;
}else if (type == SELECT)
{
buffer.append("<select name=\"" + name + "\">"

;
LabelValueBean labelValueBean = null;
String option = "";
if (null != list) {
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
labelValueBean = (LabelValueBean) iterator.next();
if(value.equals(labelValueBean.getValue()))
option = "selected";
else
option = "";
buffer.append("<option value=\"" + labelValueBean.getValue() + "\" "+ option+">" + labelValueBean.getLabel() + "</option>"

;
}
buffer.append("</select>"

;
}
}
arrayList.add(buffer.toString());
}
public ArrayList getArrayList() {
return arrayList;
}
/**
*
* @param rs
* @return
* @throws SQLException
*/
public ArrayList dbConneciton(ResultSet rs) throws SQLException {
TekBean tekBean = new TekBean();
/**
* if you have the resultSet you are going to add the values in the while loop
*/
/* while(rs.next())
{
tekBean.addToList(rs.getInt(1), rs.getString(2), rs.getString(3), null);
}*/
tekBean.addToList(1,"text1","textValue",null);
tekBean.addToList(2,"hidden1","hiddenValue", null);
List list = new ArrayList();
list.add(new LabelValueBean("one","1"

);
list.add(new LabelValueBean("two","2"

);
list.add(new LabelValueBean("three","3"

);
tekBean.addToList(3,"select1","2", list);
return tekBean.getArrayList();
}
public static void main(String[] args) {
// below code need to be in the JSP page
TekBean tekBean = new TekBean();
ArrayList arrayList = null;
try {
arrayList = tekBean.dbConneciton(null);
} catch (SQLException e) {
e.printStackTrace(); //To change body of catch statement use Options | File Templates.
}
Iterator iterator = arrayList.iterator();
while(iterator.hasNext())
{
System.out.println(iterator.next());
}
}
}
OUTPUT :
<input type="hidden" name="text1" value="textValue">
<input type="text" name="hidden1" value="hiddenValue">
<select name="select1"><option value="1" >one</option><option value="2" selected>two</option><option value="3" >three</option></select>
Cheers,
Venu