getParameter和getAttribute的区别

来源:互联网 发布:五羊宝宝洗衣液 知乎 编辑:程序博客网 时间:2024/06/04 23:27
getParameter 是用来接受用post或get方法传递过来的参数的.

getAttribute 必须先setAttribute.

当两个Web组件之间为链接关系时,被链接的组件通过getParameter()方法来获得请求参数,

当两个Web组件之间为转发关系时,转发目标组件通过getAttribute()方法来和转发源组件共享request范围内的数据。


0 0
原创粉丝点击