request.setAttribute(“xiaoxi”, “欢迎用户”+name);//向request域中放置信息 ( 键值对的形式) 名字为xiaoxi 内容为"欢迎用户"+name。
request.getAttribute(“xiaoxi”);//得到request域中放置名字为xiaoxi的信息。
request.getParameter(“name”);//得到request域的参数信息(得到jsp页面传过来的参数)。
getAttribute表示从request范围取得设置的属性,必须要先setAttribute设置属性,才能通过getAttribute来取得,设置与取得的为Object对象类型 。
getParameter表示接收参数,参数为页面提交的参数,包括:表单提交的参数、URL重写(就是xxx?id=1中的id)传的参数等,
因此这个并没有设置参数的方法(没有setParameter),而且接收参数返回的不是Object,而是String类型

getParameter与getAttribute两者的区别相关推荐

  1. 【JSP/Servlet】getParameter和getAttribute的使用、区别

    总结:request.cookie.session.context的区别 这四个对象有不同级别的作用域和生命周期. (1)request:解决了一次请求内的数据共享问题(作用域:一次请求) req.s ...

  2. request中getParameter和getAttribute的区别

    整理一下getParameter和getAttribute的区别和各自的使用范围. (1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方 ...

  3. Request的getParameter和getAttribute方法的差别

    HttpServletRequest.getParameter("modelName");能取到想要的modelObject吗?经过測试之后.发现是不能的. 后来想想.其它道理挺简 ...

  4. request.getParameter和request.getAttribute之间的区别

    HttpServletRequest类既有getAttribute()方法,也由getParameter()方法,这两个方法有以下区别: (1)HttpServletRequest类有setAttri ...

  5. JSP中getParameter和getAttribute区别

    (1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方法 (2)当两个Web组件之间为链接关系时,被链接的组件通过getParameter ...

  6. getParameter和getAttribute的区别

    转自http://blog.csdn.net/java_xiaobin/article/details/45363897 1.getAttribute是取得jsp中 用setAttribute設定的a ...

  7. request.getParameter() request.getAttribute()区别

    一.当两个Web组件之间为链接关系时,被链接的组件通过getParameter()方法来获得请求参数.例如a.jsp和b.jsp之间为链接关系, a.jsp中有以下代码: <form name= ...

  8. request.getParameter()与request.setAttribute()的区别

    request.getParameter(),request.setAttribute()区别如下: (1)request.getParameter()取得是通过容器的实现来取得通过类似post,ge ...

  9. selenium 获取元素getAttribute(“innerHTML“)和getAttribute(“outerHTML“)的区别

    selenium 获得指定元素时,想要获取元素标签内容: getAttribute("innerHTML") 返回的文本: {"query":"Bro ...

最新文章

  1. Resin介绍及其使用配置
  2. 简述Python的Numpy,SciPy和Pandas,Matplotlib的区别
  3. 自学架构设计的一个好方法
  4. delphi 中 的 Split 函数
  5. android横向滑动分享,Android将ListView逆时针旋转90°实现横向滑动
  6. 基于 Windows7 + VMware-CentOS7虚拟机 搭建开发模式
  7. Gitea Extension for Visual Studio V1.0.62 发布
  8. ztree 后台异步加载_Ztree 分批异步加载
  9. Office SharePoint Designer 2007 RTM 中文版 BT、HTTP、Emule下载
  10. 使用华为云WeLink,体验无纸化办公的这些优点
  11. 系统重启后接口代理服务器ip地址会变,重启路由器可以IP会变吗
  12. 如何租用虚拟服务器,怎么租用虚拟主机
  13. 图书管理系统课设报告(含用例图、通信图、顺序图、状态图、活动图)
  14. C/C++音频算法: noise suppression算法及技术资料汇总
  15. HTTP/HTTPS协议
  16. oppo SDK接入
  17. java验证歌德巴赫猜想
  18. pool win10提示bad_Win10怎么修复出现bad pool header蓝屏的情况?
  19. go语言爬虫比python高_越来越多的人转行Python爬虫,爬虫真的比其他语言工资更高?-Go语言中文社区...
  20. 西尔特280U 580U双芯片升级准3000U芯片 编程器 希尔特280u 580u 双芯片升级 3000u芯片 ,升级后稳定如同原厂 希尔特280u 580u都可以直接升级成3000u支持芯片翻

热门文章

  1. 自己动手制作u盘启动盘,借助UltraISO就行了
  2. android u盘 uuid,(已解决)root device uuid is 'UUID'
  3. NOAUTH Authentication required
  4. iOS学习笔记(5)— UITextField
  5. javadoc是什么
  6. HBase技术与应用实践 | HBase在爱奇艺的应用实践
  7. SQL游戏行业实战案例2:玩家等级(union、分组、排序)
  8. slf4j从LoggerFactory.getLogger()说起
  9. 微服务架构统一异常监控Sentry
  10. 练习7-11 字符串逆序(15 分)