如何在jsp中获取action传递过来的数据

如题所述

jsp中获取action传递过来的数据

代码如下:
Map request = (Map) ActionContext.getContext().get("request");
既然你知道request是一个已存在的对象,在定义对象时就不要再用request这个名字,容易给他人以及自己以后造成误解

用struts2标签可以这么做
<s:iterator value="request">
<s:property value="empId" />
<s:property value="eName" />
<s:property value="eSex" />
<s:property value="eSex" />
<s:property value="eSalary" />
</s:iterator>
温馨提示:内容为网友见解,仅供参考
无其他回答