getParameter 是用来接受用post或get方法传递过来的参数的.
getAttribute 必须先setAttribute.
当两个Web组件之间为链接关系时,被链接的组件通过getParameter()方法来获得请求参数,
当两个Web组件之间为转发关系时,转发目标组件通过getAttribute()方法来和转发源组件共享request范围内的数据。
getParameter与getAttribute详解
本文详细解释了getParameter与getAttribute在Web开发中的使用区别:getParameter主要用于获取通过GET或POST方式提交的参数;getAttribute则用于Web组件间转发时共享request范围内数据。
getAttribute 必须先setAttribute.
当两个Web组件之间为链接关系时,被链接的组件通过getParameter()方法来获得请求参数,
当两个Web组件之间为转发关系时,转发目标组件通过getAttribute()方法来和转发源组件共享request范围内的数据。
1543
476
364

被折叠的 条评论
为什么被折叠?