//servlet
if(rs.next())
{
String s1 = rs.getString("pname");
String s2 = rs.getString("remarks");
String s3= rs.getString("cnt");
String s4 = rs.getString("bsponsor");
String s5 = rs.getString("bprowner");
String s6 = rs.getString("priority");
list.add(s1);
list.add(s2);
list.add(s3);
list.add(s4);
list.add(s5);
list.add(s6);
}
session.setAttribute("list",list);
RequestDispatcher rd=getServletContext().getRequestDispatcher("/project.jsp");
rd.forward(request,response);
//jsp page
<%
ArrayList arr = (ArrayList) session.getAttribute("list");
String myString="";
if(arr.isEmpty()==false)
{
for(int i = 0; i < arr.size(); i++)
{
myString = (String)arr.get(i);
}
}
else
{
System.out.println("Array is empty");
}
%>
<tr>
<td>
project Name
</td>
<td>
<input type="text" name="pname" id="pname" size="25" value="<%=myString%>" disabled>
</td>
</tr>
<tr>
<td>
Description/Remarks
</td>
<td><input type="text" name="remarks" size="25" value="<%=myString%>" disabled>
</td>
</tr>
servlet is working fine but i am not getting desired output in jsp page.i have five fields and my control goes to servlet ,it retrieves the data from the database and redirect the control to jsp page.now i want to show values of 5 fields into respective text boxes. please help