ho risolto, grazie cmq a tutti, se a qualcuno può interessare posto il codice, questa è la classe:
codice:
public ActionForward lista(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
System.out.print("ciao");
Vector utenti = new Vector();
DataSource dataSource;
Connection myConnection = null;
try
{
dataSource = getDataSource(request,"STRUTS_DB1");
myConnection = dataSource.getConnection();
String select = "select Nome, Cognome from utente";
PreparedStatement ps = myConnection.prepareStatement(select); ResultSet rst = ps.executeQuery();
while(rst.next()){
LoginForm datiUt=new LoginForm();
String nome = rst.getString(1);
System.out.println(nome);
String cognome = rst.getString(2);
System.out.println(cognome);
datiUt.setNome(nome);
datiUt.setCognome(cognome);
utenti.add(datiUt);
request.setAttribute("lista", utenti);
}
rst.close();
ps.close();
}
catch(Exception sqle)
{
sqle.printStackTrace();
}
finally
{
try
{
myConnection.close();
}
catch(Exception sqlex)
{
sqlex.printStackTrace();
}
}
return mapping.findForward("utenti");
}
nel .xml va questo:
codice:
<action
path="/utenti"
parameter="list"
type="struts.actions.LoginAction"
>
<forward name="utenti" path="/utenti.jsp"/>
</action>
la pagina utenti.jsp:
codice:
<logic:iterate id="utenti" name="lista">
<tr>
<td>
<bean:write name="utenti" property="nome" />
</td>
<td>
<bean:write name="utenti" property="cognome" />
</td>
</tr>
</logic:iterate>
spero possa servire....