我一直在研究一个文档来描述JSTL出现之前的jsp场景。我必须迭代列表并使用usebean标准操作和scriptlet打印其属性。谁能帮我解决这个问题?在标签中我得到错误重复的局部变量。
<% @SuppressWarnings("unchecked")
ArrayList<Player> list = (ArrayList<Player>) application
.getAttribute("PlayersList");
for (Player player : list) { %> <jsp:useBean id="player"
class="com.soccer.model.Player" scope="page">
Name: <jsp:getProperty name="player" property="name" />
Team: <jsp:getProperty name="player" property="team" />
Age: <jsp:getProperty name="player" property="age" />
City: <jsp:getProperty name="player" property="city" />
</jsp:useBean>
<% } %>