hongchengshise
  1. request.getParameter() 返回客户端的请求参数的值;request.getParameterNames() 返回所有可用属性名的枚举; request.getParameterValues() 返回包含参数的所有值的数组。

  2. request.getAttribute()。

  用途上:

  • request.getAttribute(), 一般用于获取request域对象的数据(在跳转之前把数据使用setAttribute来放到request对象上)

  • request.getParameter(), 一般用于获取客户端提交的参数

  

  存储数据上:

  • request.getAttribute()可以获取Objcet对象

  • request.getParameter()只能获取字符串(这也是为什么它一般用于获取客户端提交的参数)

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-08-04
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案