jsp读取action参数方式有三种。
一、action中使用get set方法 ,JSP使用OGNL表达式
取值,注意返回结果类型为forward
for example
<s:property value="name"/>
<s:property value="user.name"/>
二、通过ActionContext传值,在Action中所调用的方法中加入:
ActionContext.getContext().put("key", "value");
JSP:
<s:property value="#key"/>
三、通过request、session 传值。Action方法中通过取得HttpServletRequest 、HttpSession 和 Map对象设置值,
for example:
action.java
ServletActionContext.getRequest().setAttribute("arg0", "value");
ServletActionContext.getRequest().getSession().setAttribute("arg0", "value");
ActionContext.getContext().getSession().put("key", "value");
jsp:
```
<s:property value="#key"/>