<body>
<table border="1" width="80%" height="10%">
<tr>
<td>index</td>
<td>PRODUCT_ID</td>
<td>NAME</td>
<td>AUTHOR</td>
<td>BASEPRICE</td>
</tr> <c:forEach items="${list}" var="product" varStatus="status">
<tr>
<td>${status.count}</td>
<td>${product.id}</td>
<td><a href="${pageContext.request.contextPath}/product/findById?
<!--这地方/product/findById是实现类的方法吗还是什么,是不是调用错了-->
<!-- 报错是“The requested resource (/myproject/product/findById) is not available.”-->
product_id=${product.id}">${product.name}</a></td>
<td>${product.author}</td>
<td>${product.basePrice}</td>
</tr>
</c:forEach>
</table>
</body>
<table border="1" width="80%" height="10%">
<tr>
<td>index</td>
<td>PRODUCT_ID</td>
<td>NAME</td>
<td>AUTHOR</td>
<td>BASEPRICE</td>
</tr> <c:forEach items="${list}" var="product" varStatus="status">
<tr>
<td>${status.count}</td>
<td>${product.id}</td>
<td><a href="${pageContext.request.contextPath}/product/findById?
<!--这地方/product/findById是实现类的方法吗还是什么,是不是调用错了-->
<!-- 报错是“The requested resource (/myproject/product/findById) is not available.”-->
product_id=${product.id}">${product.name}</a></td>
<td>${product.author}</td>
<td>${product.basePrice}</td>
</tr>
</c:forEach>
</table>
</body>
HttpSession session=request.getSession();
List<String>list=new ArrayList<String>();
list.add("http://www.hao123.com");
list.add("http://www.baidu.com.com");
session.setAttribute("list", list);
request.getRequestDispatcher("index.jsp").forward(request, response);
jsp<table>
<c:forEach var="test" items="${sessionScope.list}">
<tr>
<td><a href="${test}">${test}</a></td>
</tr>
</c:forEach>
</table>
类似于这样试试
<s:iterator value="list" id="order" >
<tr align="left">
<td><input type="button" value="${orderID}" class="button1" onclick="window.location.href='orderDetail.action?orderId=${orderID}'"/></td>
<!-- <td>${tradeNo}</td>-->
<td>${itemName}</td>
<td>${userID}</td>
<td>${strStatus}</td>
<td>${quantity}</td>
<td>${amount}</td>
<!-- <td>${method}</td>-->
<td>${totalFee}</td>
<td>
<input type="button" value="${tradeNo}" class="button1" onclick="window.location.href='tradeDetail.action?orderID=${orderID}'"/></td>
</td>
<td><s:date name="created" format="yyyy-MM-dd" /></td>
</tr>
</s:iterator>
struts2现在是主流。我在上班的同时学习,用了一个月,边做边学。