在Struts2中,向JSP页面传递List实例可以通过Action的result标签中的属性实现。以下是一个简单的例子,展示如何从Action中传递一个List实例到JSP页面。

创建一个名为`StudentAction`的Action类,该类有一个List类型的属性`students`。

struts2向jsp传递list实例,Struts2向JSP传递List实例  第1张

```java

package com.example.action;

import java.util.ArrayList;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;

public class StudentAction extends ActionSupport {

private List students;

public List getStudents() {

return students;

}

public void setStudents(List students) {

this.students = students;

}

public String execute() {

// 假设这里是从数据库或者其他地方获取学生信息

students = new ArrayList();

students.add(new Student("