public class BrandDetails extends SqlContainer{
public static ArrayList<UserUtilityModel> getDetailsofBrands()
{
ArrayList<UserUtilityModel> alist=new ArrayList<UserUtilityModel>() ;
System.out.print("Get the Brand values");
PreparedStatement stmt=null;
Connection conn=null;
ResultSet rs=null;
try
{
String sql=SqlContainer.getBrandDetailsSQL;
conn=ULDBConnectionUtility.getDBConnection();
stmt=conn.prepareStatement(sql);
// stmt.setString(1,branchName);
rs=stmt.executeQuery();
while(rs.next())
{
UserUtilityModel brand=new UserUtilityModel();
brand.setBrandId(rs.getInt("BRAND_ID"));
brand.setManufacureId(rs.getInt("MANUFACTURER_ID"));
brand.setBrandName(rs.getString("BRAND_NAME"));
brand.setBrandDesc(rs.getString("BRAND_DESC"));
brand.setStatus(rs.getString("STATUS"));
alist.add(brand);
}
System.out.print(alist);
}
return alist;
}
我在 struts2 中使用 getter 和 setter 方法显示数据库记录,但我不知道如何在 jsp 页面中获取数组列表值。任何人都可以帮助我解决这个问题。