当Action设置了某个属性值后,Struts2将这些属性值全部封装在一个叫做struts.valueStack的请求属性里。
<%@ page language="java" contentType="text/html; charset=GBK">
<% @page import="java.util.*,com.opensymphony.xwork2.util.*"%>
<html>
<head>
<title></title>
</head>
<body>
<table border="1" width="360">
<caption></caption>
<%
//ValueStack
ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack")
//ValueStackfineValueActionbooks
String[] books = (String[])vs.findValue("books");
//
for (String book : books)
{
%>
<tr>
<td></td>
<td><%=book%></td>
</tr>
<%}%>
</table>
</body>
</html>
struts.valueStack讲解
最新推荐文章于 2024-04-17 16:41:00 发布