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


 

猜你喜欢

转载自blog.csdn.net/weixin_59519449/article/details/124623558
今日推荐