在Java Web开发中,MVC(Model-View-Controller)模式是常用的设计模式之一。在这种模式中,Controller负责处理用户的请求,Model负责存储数据,而View负责展示数据。在这个例子中,我们将展示如何在JSP页面中遍历MVC模式中的Controller返回的List集合实例。
我们需要在Controller层创建一个方法,该方法返回一个List集合实例。假设我们有一个名为`Product`的类,它代表产品信息,以及一个名为`ProductController`的类,其中包含一个返回Product列表的方法。

```java
// Product.java
public class Product {
private int id;
private String name;
private double price;
// 构造器、getters和setters
public Product(int id, String name, double price) {
this.id = id;
this.name = name;
this.price = price;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
}
// ProductController.java
public class ProductController {
public List
// 假设这里从数据库或者其他地方获取了产品列表
List
productList.add(new Product(1, "







