当前位置: 代码迷 >> J2EE >> Struts2中,Action中字段是在什么时候放到request的attributes里的,该怎么解决
  详细解决方案

Struts2中,Action中字段是在什么时候放到request的attributes里的,该怎么解决

热度:18   发布时间:2016-04-22 00:35:34.0
Struts2中,Action中字段是在什么时候放到request的attributes里的
在TestAction里设置一个message字段,并且创建getter,setter
我疑惑的是,在jsp页面中用${message}也可以取值,访问的是
TestAction的getter,请问

1.为什么el能取到值,但我监视jsp页面中的request里并没有message相关的attribute?
2.struts2是在什么时候将TestAction里message属性放到request里的(OgnlValueStack类里找半天也没找到-_-!!!)?


------解决方案--------------------
struts2 本身就是对HttpServletRequest 做了一定的封装,所以El表达式可以访问。

你可以看看这篇:http://baiyan425.blog.51cto.com/1573961/777413
  相关解决方案