Struts2中的ValueStack
<%
Enumeration em = request.getAttributeNames();
while(em.hasMoreElements()){
Object obj = em.nextElement();
if(obj.equals("struts.valueStack")){
ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");
System.out.println(vs.findValue("username"));
System.out.println(vs.findValue("password"));
System.out.println(vs.findValue("[0].username"));
System.out.println(vs.findValue("[0].password"));
vs.toString();
}
}
%>
哈哈,原来Struts2在视图里是这样子拿到值的呀