在 some.jsp 我有这个代码:
<%
ArrayList<Team> teams = Lists_DEO.getAllTeams();
for (int i = 0; i < teams.size(); i++){
Team curr = teams.get(i);
%>
<div class="team-item-box <% if (i%2 == 1) out.print("second");%>">
<a href="/FUF_League/UserGetTeam?teamID=<%=curr.getID()%>" class="left"><img src="<%= curr.getImageURL() %>" alt=""></a>
<a href="/FUF_League/UserGetTeam?teamID=<%=curr.getID()%>" class="watch-now"><%= curr.getName()%></a>
</div>
<%
}
%>
它完成了它的工作......(我已经检查了 out.print 并且每个 teamID 都有其独特的价值);
在 UserGetTeam (servlet) 我有这个代码:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.print(request.getAttribute("teamID"));
RequestDispatcher dispatch = request.getRequestDispatcher("/UserPages/UserGetTeam.jsp");
dispatch.forward(request, response);
}
它打印出“空”...
有什么问题?我在 github 上工作,在这个项目上,这段代码在几个小时前就可以工作了,但现在没有,没有人改变/提交这个特定的 servlet 或 jsp ......