getParameter和getAttribute的区别

getParameter():是用来接受用post或get方法传递过来的参数的.

getAttribute():必须先setAttribute()

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

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

猜你喜欢

转载自www.cnblogs.com/yifanSJ/p/9217473.html