request.getAttribute()和 request.getParameter()有何区别

a、request.getParameter()取得是通过容器的实现来取得通过类似post,get等方式传入的数据。      b、getAttribute是返回对象,getParameter返回字符串

c、getAttribute()一向是和setAttribute()一起使用的,只有先用setAttribute()设置之后,才能够通过getAttribute()来获得

值,它们传递的是Object类型的数据。而且必须在同一个request对象中使用才有效。,而getParameter()是接收表单的get或者  post提交过来的参数

原文地址:https://www.cnblogs.com/moranqingcheng/p/14246269.html