request.getParameter()简介

request.getParameter()方法:1.获取通过http协议提交过来的数据.       通过容器的实现来取得通过get或者post方式提交过来的数据

2.request.getParameter()方法传递的数据,会从web客户端传到web服务器端,代表HTTP请求数据,该方法返回String类型的数据

request.setAttribute()和getAttribute()只是在web容器内部流转,仅仅是请求处理阶段

 

request.getAttribute()方法返回request范围内存在的对象

 

request.setAttribute() 和 getAttribute() 方法传递的数据只会存在于Web容器内部

HttpServletRequest 类有 setAttribute() 方法,而没有setParameter() 方法
一般通过表单和链接传递的参数使用getParameter

posted @ 2020-11-29 17:36  zhen3  阅读(921)  评论(0编辑  收藏  举报