getParameter和getAttribute的区别
1.getAttribute 是取得jsp中 用setAttribute 设定的attribute
2.parameter得到的是String;attribute得到的是object
3.request.getParameter()方法传递的数据,会从Web客户端传到Web服务器端,代表HTTP请求数据;request.setAttribute()和getAttribute()方法传递的数据只会存在于Web容器内部,在具有转发关系的Web组件之间共享。即getAttribute()方法返回request范围内存在的对象,而getParameter()方法是获取http提交过来的数据。
总结:
getattribute一般用于前台获取后台转发值
getparameter一般用于后台获取前台请求值
getParameter和getAttribute的区别的更多相关文章
- request中getParameter和getAttribute的区别
整理一下getParameter和getAttribute的区别和各自的使用范围. (1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方 ...
- getParameter 与 getAttribute的区别
request.getAttribute():是request时设置的变量的值,用request.setAttribute("name","您自己的值");来设 ...
- Request的getParameter和getAttribute方法的区别
下面整理一下getParameter和getAttribute的区别和各自的使用范围. (1)HttpServletRequest类有setAttribute()方法,而没有setParam ...
- 【转】HttpServletRequest.getParameter() &HttpServletRequest.getAttribute() 区别
Ref: HttpServletRequest的getParameter和getAttribute方法有什么区别 具体如下几点: (1)HttpServletRequest类有setAttribute ...
- getParameter和getAttribute有什么区别
1.getAttribute是取得jsp中 用setAttribute設定的attribute 2.parameter得到的是string:attribute得到的是object 3.request. ...
- Request的getParameter和getAttribute方法的差别
HttpServletRequest.getParameter("modelName");能取到想要的modelObject吗?经过測试之后.发现是不能的. 后来想想.其它道理挺简 ...
- 〖转〗request.getparameter()和request.getAttribute()的区别
getAttribute表示从request范围取得设置的属性,必须要先setAttribute设置属性,才能通过getAttribute来取得,设置与取得的为Object对象类型 getParame ...
- JSP中getParameter和getAttribute区别
(1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方法 (2)当两个Web组件之间为链接关系时,被链接的组件通过getParameter ...
- getParameter和getAttribute区别
(1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方法 (2)当两个Web组件之间为链接关系时,被链接的组件通过getParameter ...
随机推荐
- NullPointerException空指针异常——没有事先加载布局文件到acitivy——缺少:setContentView(R.layout.activity_setup_over);
空指针异常: 04-27 01:13:57.270: E/AndroidRuntime(4942): FATAL EXCEPTION: main04-27 01:13:57.270: E/Androi ...
- python之json序列
# from urllib import request## f=request.urlopen("http://123.178.101.29:81/xs_main.aspx?xh=2015 ...
- python 统计单词个数,并按个数与字母排序
# coding: utf-8 # In[1]: import collections str = "Be slow to promise and quick to perform" ...
- emacs安装及配置
目录 平台 安装 基本配置 配置文件结构 elpa仓库管理 主题配色 字体显示配置(解决中文卡顿) 插件配置 markdown 简介 markdown-mode markdown-toc org导出m ...
- cdh日常维护常见问题及解决方案
为数据节点添加新硬盘 - 挂载硬盘到指定文件夹.如`/dfs_diskb`: - 打开cloudera manager -> hdfs -> 配置 -> DataNode -> ...
- C#安装Telnet
1.打开电脑控制面板: 2.“查看方式”改成小图标: 3.点击“程序和功能”: 4.在左侧选择“启用或关闭Windows功能”: 5.选择“Telnet服务器”.Telnet客户端: 6.点击“确定” ...
- SQL-50 将employees表中的所有员工的last_name和first_name通过(')连接起来
题目描述 将employees表中的所有员工的last_name和first_name通过(')连接起来.CREATE TABLE `employees` (`emp_no` int(11) NOT ...
- MinHook测试分析02 (x64)
在X64模式中,存在的问题是JMP指令和整个地址空间相比仅仅覆盖了很窄的范围.因此引入一个中继函数(Relay Function)来实现对64位Detour函数地址的跳转. 在hook的分析之前,先谈 ...
- position三种属性的区别
1.static(静态定位):默认值.没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明). 2.relative(相对定位):生成相对 ...
- C# 索引和长度必须引用该字符串内的位置 LENGTH
今天遇到了 索引和长度必须引用该字符串内的位置 的问题. 原因是实用 Substring 对字符串进行了前五位的截取,但是忽略了字符串本身不足五位的情况. 如果不足五位,直接将整个字符串赋值过来,添加 ...